home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr36 / gapcdr6.zip / GAPCDR.TXT < prev    next >
Text File  |  1993-04-19  |  161KB  |  5,284 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.                          GAP Communications Online Software
  29.  
  30.  
  31.  
  32.  
  33.                                        GAPCDR
  34.  
  35.                                Door Interface Library
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.           Copyright (C) 1987-1993 by GAP Development Company.
  43.  
  44.  
  45.           ALL RIGHTS  RESERVED. No part of this manual shall be reproduced,
  46.           stored in  a retrieval  system,  or  transmitted  by  any  means,
  47.           electronic, mechanical,  photocopying, recording,  or  otherwise,
  48.           without written  permission from  GAP Development  Company. While
  49.           every precaution  has been  taken  in  the  preparation  of  this
  50.           manual, GAP  Development Company  assumes no  responsibility  for
  51.           errors or omissions. Neither is any liability assumed for damages
  52.           resulting from the use of the information contained herein.
  53.  
  54.  
  55.           GAPCDR is  the sole  and exclusive  property of  GAP  Development
  56.           Company. It  is licensed  and not  sold  to  the  end  user  with
  57.           restrictions placed upon its use.
  58.  
  59.  
  60.           GAPCDR is copyrighted by GAP Development Company.
  61.           DESQview is a trademark of Quarterdeck.
  62.           PCBoard is a trademark of Clark Development Corporation.
  63.           WildCat! is copyrighted by Mustang Software.
  64.           DigiBoard is a trademark of DigiBoard Incorporated.
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.           Contents
  72.  
  73.  
  74.  
  75.           Description                                                     5
  76.  
  77.                Major Features                                             5
  78.  
  79.  
  80.           Getting Started                                                 7
  81.  
  82.                Supported Compilers                                        8
  83.                Using GAPCDR                                               8
  84.                Points To Remember                                        11
  85.                Compiling And Linking                                     12
  86.                Using A Goto                                              13
  87.                BBS System Files                                          14
  88.  
  89.  
  90.           Sysop Setup And Functions                                      14
  91.  
  92.                Configuration                                             15
  93.                Sysop Functions                                           17
  94.  
  95.  
  96.           Advanced Applications                                          18
  97.  
  98.                Communications                                            18
  99.                DOS Window                                                20
  100.  
  101.  
  102.           Variables                                                      22
  103.  
  104.                Defines                                                   22
  105.                Ansi Variables                                            22
  106.                DOOR.SYS Variables                                        23
  107.                Global Variables                                          25
  108.  
  109.  
  110.           Functions - Quick Reference                                    27
  111.  
  112.  
  113.  
  114.           Functions - Detailed Reference                                 28
  115.  
  116.  
  117.  
  118.           Index                                                          81
  119.  
  120.  
  121.  
  122.                                        Page 3
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.                                        Page 4
  181.  
  182.  
  183.  
  184.           GAP Communications                                         GAPCDR
  185.  
  186.  
  187.  
  188.  
  189.           Description          Description
  190.  
  191.  
  192.           GAPCDR is  a professional development kit for Bulletin Board Door
  193.           programmers. Written in Microsoft C version 7 and MASM version 6,
  194.           it is  fast, reliable,  easy to use, and easy to incorporate into
  195.           the serious  programmer's source  code. It consists of a set of C
  196.           and assembler library routines to allow for easy door programming
  197.           and interfacing. Borland C compatability is included.
  198.  
  199.  
  200.           Major Features          Major Features
  201.  
  202.              Interfaces with  GAP Communications,  PCBoard, WildCat, and
  203.              other fine  BBS programs  that are  capable  of  writing  a
  204.              DOOR.SYS file.
  205.  
  206.              Full communications  support including the DigiBoard COM/Xi
  207.              series of Intelligent Multi-Port boards.
  208.  
  209.              Supports the FIFO buffers of the 16550 UART chip.
  210.  
  211.              Speeds up to 115,200 baud.
  212.  
  213.              Communications ports other than Com 1 and Com 2 possible.
  214.  
  215.              Supports CTS/RTS, automatically.
  216.  
  217.              Does not require watchdog or CTTY.
  218.  
  219.              Fully self contained, built in ANSI driver.
  220.  
  221.              Sysop sees what the caller sees.
  222.  
  223.              High speed text file display.
  224.  
  225.              Supports  ANSI   color  and   ASCII  text   files  with  no
  226.              programming effort  other than  to make  a single  function
  227.              call.
  228.  
  229.              Easy to use Random Number Generator.
  230.  
  231.              Informative Status Line display.
  232.  
  233.              Monitors keyboard activity and caller time remaining.
  234.  
  235.  
  236.  
  237.  
  238.                                        Page 5
  239.  
  240.  
  241.  
  242.           GAP Communications                                         GAPCDR
  243.  
  244.  
  245.              Easy interface to BBS system.
  246.  
  247.              Sysop chat with full word wrapping.
  248.  
  249.              Allows the sysop to shell to DOS.
  250.  
  251.              "Remembers" the  default drive and directory which prevents
  252.              file access errors.
  253.  
  254.              Credits caller  with time  spent chatting or while sysop is
  255.              in a DOS shell.
  256.  
  257.              Sysop can twit caller without caller ever knowing the sysop
  258.              is watching.
  259.  
  260.              Caller time can be increased or decreased.
  261.  
  262.              Full programmer control of whether or not to update the BBS
  263.              system files.
  264.  
  265.              Time calculations  are not  dependent on the "seconds since
  266.              midnight" and  are thus  unsusceptible to the midnight roll
  267.              over.
  268.  
  269.              Timer routines are hardware independent.
  270.  
  271.              Automatic detection of multi-user system.
  272.  
  273.              Input routines are consistent throughout the program.
  274.  
  275.              Uses the latest in Microsoft C and MASM features.
  276.  
  277.              Extremely easy interfacing to door programs.
  278.  
  279.              Fully DESQView aware video routines as well as keyboard and
  280.              COM input routines, and COM output routines.
  281.  
  282.  
  283.  
  284.           GAPCDR includes  robust Communications  routines which  are fully
  285.           interrupt driven. Written in highly optimized assembler, they are
  286.           capable of  operating at  any speed which the UART on an IBM type
  287.           of computer  is capable  of producing.  The FIFO  buffers in  the
  288.           16550 UART  are fully  supported. CTS/RTS  checking is automatic,
  289.           and  carrier   detect  is   an  integral  part  of  each  of  the
  290.           communications input and output routines. When there is a loss of
  291.           carrier, a  function in the main GAPCDR code will be called. This
  292.  
  293.  
  294.  
  295.  
  296.                                        Page 6
  297.  
  298.  
  299.  
  300.           GAP Communications                                         GAPCDR
  301.  
  302.  
  303.           function defaults  to shutting down the door and returning to the
  304.           BBS, however you may modify it to do whatever you wish.
  305.  
  306.           The built  in ANSI driver makes GAPCDR a self contained unit. The
  307.           driver is  smart enough  to know when a caller does not want ANSI
  308.           sequences sent  to his  computer and  it will filter out any such
  309.           codes that  pass through  it. This  allows you  to create prompts
  310.           with embedded  ANSI sequences  and display them without regard as
  311.           to whether  or not  the caller  has color  "turned on". This also
  312.           means you do not have to keep two sets of prompts (one with color
  313.           attributes and  one without).  This is  a great savings to you in
  314.           precious DATA  space. You  may also  use the  ANSI driver to send
  315.           color strings to the local monitor. Even if the caller is in mono
  316.           mode, you  may still  send color  strings and prompts to the ANSI
  317.           driver and have them displayed in color on the local monitor.
  318.  
  319.           GAPCDR supports  only the  DOOR.SYS  format  for  passing  caller
  320.           information to  a door.  We choose  this format  because  of  its
  321.           universal acceptance  and its  inherent ability to remain stable.
  322.           BBS programs  frequently change  and with  those changes  usually
  323.           come modifications  to the  system files  they create to interact
  324.           with door  programs. DOOR.SYS  on the  other hand was designed to
  325.           include as  much  information  about  a  caller  as  was  thought
  326.           necessary. Should  new fields  be needed  to take care of new BBS
  327.           features, it  is a  simple matter  to add these new fields to the
  328.           end of  the file,  thereby making the new version compatible with
  329.           all prior versions. Most major BBS programs support DOOR.SYS.
  330.  
  331.  
  332.  
  333.           Getting Started          Getting Started
  334.  
  335.  
  336.           GAPCDR is  distributed in  archived format.  The contents  of the
  337.           archive should be as follows:
  338.  
  339.             GAPCDR.TXT      - Disk based documentation.
  340.             GAPCDRS.LIB     - Small model Library routines.
  341.             GAPCDRL.LIB     - Large model Library routines.
  342.             GAPCDRBS.LIB    - Small model Library routines for BC.
  343.             GAPCDRBL.LIB    - Large model Library routines for BC.
  344.             GAPCDR.H        - Door Interface include file.
  345.             GAPSTRUC.H      - Door Interface include file.
  346.             CDOOR.ZIP       - Sample program  illustrating many  of the
  347.                               features of GAPCDR.
  348.             READ.ME         - Any  pertinent   information  which   you
  349.                               should read.
  350.  
  351.  
  352.  
  353.  
  354.                                        Page 7
  355.  
  356.  
  357.  
  358.           GAP Communications                                         GAPCDR
  359.  
  360.  
  361.           If you  licensed the  source code to GAPCDR you will receive most
  362.           of the ASM, C, INC, H, BAT, and OBJ files that make up the GAPCDR
  363.           library. We  include both  Microsoft and  Borland batch  files to
  364.           compile the source modules.
  365.  
  366.  
  367.           Supported Compilers          Supported Compilers
  368.  
  369.           We used  the Microsoft  C compiler  version 7.0,  the Borland C++
  370.           Compiler  version  3.0,  and  MASM  version  6.  The  linker  and
  371.           librarian were from their respective compilers.
  372.  
  373.           Since GAPCDR  uses no  floating point  math, the  C modules  were
  374.           compiled with  the /FPa switch for Microsoft. This is the default
  375.           for Borland,  so no  switches are  necessary. For Microsoft C, in
  376.           order to  use the  /FPa switch,  you must  tell the SETUP program
  377.           that you  want to create the Alternate Floating Point library. It
  378.           will then  create a  set of  libraries that  make  calls  to  the
  379.           Alternate Math  library instead  of  the  Emulator  Library.  The
  380.           difference in  code size  for a large model program that uses the
  381.           Alternate library as opposed to the Emulator library is typically
  382.           around 10k.  Even if  you do not use floating point arithmetic in
  383.           your program, the Math Library will still be linked in because it
  384.           contains the  routines to do long arithmetic. So, the smaller the
  385.           library, the smaller your programs!
  386.  
  387.           Place the  GAPCDR files in your work directory. You may place the
  388.           LIB files in the MSC\LIB or BORLAND\LIB directory.
  389.  
  390.           The text  editor you  use must  allow control  characters  to  be
  391.           entered and  displayed. The  ANSI variables  are initialized with
  392.           literal characters  and if  your editor removes the ESC character
  393.           from the strings, your ANSI displays will be quite messy.
  394.  
  395.  
  396.           Using GAPCDR          Using GAPCDR
  397.  
  398.           At the  very beginning  of your  program, you  must  include  the
  399.           GAPCDR.H file.  Without this  file,  nothing  will  work.  It  is
  400.           normally included  after the C header files that your program may
  401.           need. To include the file, you type the following after including
  402.           the regular C header files:
  403.  
  404.                #include "gapcdr.h"
  405.  
  406.           GAPCDR.H  contains  the  declarations  for  the  external  global
  407.           variables. In addition, it includes GAPSTRUC.H which contains the
  408.           structure declarations and the function prototypes.
  409.  
  410.  
  411.  
  412.                                        Page 8
  413.  
  414.  
  415.  
  416.           GAP Communications                                         GAPCDR
  417.  
  418.  
  419.                Note: Any  of your source modules that include GAPCDR.H
  420.                must have  an include  declaration for STDIO.H prior to
  421.                including GAPCDR.H.  It should  be standard practice to
  422.                include STDIO.H  in your source modules anyway, so this
  423.                shouldn't present any problems.
  424.  
  425.           The first  thing that must be done prior to using any of the door
  426.           functions, is  to initialize  GAPCDR itself. This is accomplished
  427.           by making  a call  to read_cnf.  Read_cnf opens the configuration
  428.           file (the  name of  which you  pass as  a parameter  on the  door
  429.           command line) and reads the first eight lines of the file. If the
  430.           configuration file  cannot be  found, the  program will  end. The
  431.           format of the configuration file is as follows:
  432.  
  433.  
  434.  
  435.                            c:\gap
  436.                            The Crow's Nest
  437.                            0
  438.                            0
  439.                            STANDARD
  440.                            D000
  441.                            320
  442.                            4
  443.  
  444.  
  445.           The first  line of  the file  is the  path  to  the  BBS  default
  446.           directory. The second line is the name of the BBS. The third line
  447.           is the Port IRQ and the 4th line is the Port Base Address. If the
  448.           sysop running  your program  has his  BBS configured  to use  Com
  449.           Ports other  than 1  or 2,  he would  then enter the IRQ and Base
  450.           address for  his Com  Port on  lines 3  and 4. GAPCDR derives the
  451.           Port Number from the DOOR.SYS file.
  452.  
  453.           Lines five through eight are for the Intelligent DigiBoard multi-
  454.           port Communications  Card. The  DigiBoard  routines  specifically
  455.           support the  COM/Xi series.  All four of these lines are required
  456.           even if  your end  users are  using the  Standard Interface. Line
  457.           five is  the Communications Port Interface. It must be one of the
  458.           following:
  459.  
  460.                     STANDARD    DIGIBOARD   INT14/EBIOS
  461.  
  462.           The Standard  interface is the one that will normally be used. If
  463.           an end  user is  using a  DigiBoard then  either the DigiBoard or
  464.           Int14/EBIOS interface  may be  selected. Most sysops will use the
  465.           Int14/EBIOS interface.  All  input/output  to  the  DigiBoard  is
  466.           performed via  Interrupt 14  calls and a Device Driver (available
  467.  
  468.  
  469.  
  470.                                        Page 9
  471.  
  472.  
  473.  
  474.           GAP Communications                                         GAPCDR
  475.  
  476.  
  477.           from DigiBoard) handles the interface between the program and the
  478.           board. The  DigiBoard interface  uses Direct  Programming. GAPCDR
  479.           talks to the board directly without the need for a Device Driver.
  480.           In order  to use  this interface,  a program  called RESETDIG.EXE
  481.           must be used in the AUTOEXEC.BAT file to reset the DigiBoard once
  482.           when the  computer is first booted. If the end user does not have
  483.           this program (it is a part of the GAP Communications BBS package)
  484.           then the Int14/EBIOS interface must be used.
  485.  
  486.           If the  Interface is  other than STANDARD, then lines 6 through 8
  487.           will be  ignored. If  the Interface  is INT14/EBIOS, then lines 6
  488.           and 7 will be ignored.
  489.  
  490.           Line 6  is the  DigiBoard Memory Window, or the address the board
  491.           uses as  a  communications  area  between  itself  and  the  Host
  492.           Computer. This  line is  used only  if the  Interface is  set  to
  493.           DIGIBOARD. It  can be  set to  0 if  the Interface is STANDARD or
  494.           INT14/EBIOS.
  495.  
  496.           Line 7  is the DigiBoard I/O Port Address. This line is used only
  497.           if the  Interface is  set to  DIGIBOARD  and  can  be  set  to  0
  498.           otherwise.
  499.  
  500.           Line 8 is the DigiBoard Channel Number. This line is required for
  501.           the DIGIBOARD  and INT14/EBIOS  Interfaces. It  is normally 1 - 8
  502.           for the  DIGIBOARD Interface  and 4  -  11  for  the  INT14/EBIOS
  503.           Interface. The  Channel Number  is similar  to a  Port Number. It
  504.           tells the  program which of the DigiBoard Communications ports to
  505.           use.
  506.  
  507.           The configuration  file is  usually given  a name  similar to the
  508.           name of  your door  program, with  a CNF extension. Read_cnf will
  509.           leave this  file open for your use. If you have any configuration
  510.           options of  your own,  you may  place them in this file beginning
  511.           with line  9. Do  not read your configuration options until after
  512.           making a  call to  init_door (which should be the second function
  513.           call in  your program).  Upon return from init_door, you are free
  514.           to read  your configuration  options (if  any). At this time, you
  515.           should close the configuration file.
  516.  
  517.           Normally, your  program is  invoked with a command line parameter
  518.           giving the name of the configuration file to use:
  519.  
  520.                DOOR DOOR.CNF
  521.  
  522.           You would use the argv parameter to your main function to extract
  523.           the configuration  parameter and  then pass  this parameter on to
  524.           read_cnf. This  allows the end user to use a single program (your
  525.  
  526.  
  527.  
  528.                                        Page 10
  529.  
  530.  
  531.  
  532.           GAP Communications                                         GAPCDR
  533.  
  534.  
  535.           program) with  multiple configuration  files. This  is especially
  536.           important under  multi-user systems  where separate configuration
  537.           files are needed.
  538.  
  539.           The configuration  file is  opened as a stream, so using fgets or
  540.           any of  the stream  input  functions  would  be  appropriate  for
  541.           reading the  data. Remember  that the file pointer is passed back
  542.           to you  after the  call to  read_cnf. An example of the first few
  543.           "door" statements that might appear in a source file would be:
  544.  
  545.              FILE *cnf_file;                 // pointer to config file
  546.  
  547.              cnf_file = read_cnf(argv[1]);   // read the cnf file
  548.              init_door();                    // init the door
  549.              fclose(cnf_file);               // close the cnf file
  550.  
  551.  
  552.           If there  were no errors, read_cnf will return. You must now make
  553.           a call  to init_door. Init_door uses the information derived from
  554.           line 1  of the  configuration file  to open and read DOOR.SYS. In
  555.           addition, init_door  opens the  communications port  (if a remote
  556.           user is  on), initializes  some global variables, initializes the
  557.           random  number   generator,  initializes  the  ANSI  driver,  and
  558.           installs a  Ctrl-Break handler.  If there  is an error, init_door
  559.           will not return. Instead it will end the program.
  560.  
  561.           That is  basically all  you have  to do  to initialize the GAPCDR
  562.           module. When  your  program  ends,  you  should  clean  house  if
  563.           necessary and  call leave.  Leave closes  the communications port
  564.           and any  open files,  restores the ISR routines to their original
  565.           state, sends  a sign off message to the caller, and then exits to
  566.           DOS. It  is of vital importance to exit the door by making a call
  567.           to leave.  Failure to  do so  will leave communication interrupts
  568.           active and  the ctrl-break intercept active. The vectors to these
  569.           routines will  be left  in the  interrupt vector  table  and  the
  570.           computer will surely lock up the first time any program is run.
  571.  
  572.  
  573.           Points To Remember
  574.  
  575.              To get  the ball  rolling, include  GAPCDR.H  after  the  C
  576.              header files.
  577.  
  578.              To initialize the door, call read_cnf with the name of your
  579.              program's configuration file. Then call init_door.
  580.  
  581.              Call leave when your program is finished.
  582.  
  583.  
  584.  
  585.  
  586.                                        Page 11
  587.  
  588.  
  589.  
  590.           GAP Communications                                         GAPCDR
  591.  
  592.  
  593.              All input and output should be performed through the GAPCDR
  594.              functions. The sample program gives good examples on how to
  595.              accomplish this.  If you  use the C runtime output routines
  596.              such as  printf or  cputs, the  local screen will be a mess
  597.              because the  internal ANSI  driver will  not know where the
  598.              cursor is.
  599.  
  600.              To determine  if the  BBS is a single or multi user system,
  601.              check the  variable called  multi. If  it is anything other
  602.              than  0,   then  the  BBS  is  multi-user  and  you  should
  603.              read/write your data files with sharing attributes.
  604.  
  605.              Do not  use any  of the  BBS  specific  functions  such  as
  606.              read_pcbsys or  read_gapuser  unless  you  know  that  your
  607.              program is running with the appropriate BBS system. You may
  608.              want to  use a flag in your configuration file to determine
  609.              which system  your program is running with. These functions
  610.              were provided  to make  your programming choores easier but
  611.              using them  basically restricts your door to the respective
  612.              BBS system that the functions interact with.
  613.  
  614.              To test  your program,  you will  need a DOOR.SYS file that
  615.              was written  for local  exit. Of  course,  you  can  always
  616.              modify any  DOOR.SYS file and change the first line so that
  617.              it reads COM0:. A complete set of sample files are provided
  618.              for testing your program under local mode.
  619.  
  620.  
  621.           Compiling And Linking          Compiling And Linking
  622.  
  623.           GAPCDR has  already been compiled with the necessary compile time
  624.           switches for both Microsoft C and Borland C.
  625.  
  626.           To compile  your programs, use whatever switches are required for
  627.           your compiler.
  628.  
  629.             Microsoft C
  630.  
  631.             cl /c /FPa door.c
  632.             link door,,NUL.MAP,+GAPCDRx
  633.  
  634.             Borland C
  635.  
  636.             bcc -c door.c
  637.             tlink c0x+door,door.exe,NUL.MAP,+GAPCDRBx+Cx
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.                                        Page 12
  645.  
  646.  
  647.  
  648.           GAP Communications                                         GAPCDR
  649.  
  650.  
  651.           Where door  is the  name of  your program  and 'x' is 'S' for the
  652.           small model library or 'L' for the large model library.
  653.  
  654.           As was  mentioned previously,  GAPCDR was  compiled with the /FPa
  655.           option  for   Microsoft  C.  The  /FPa  option  produces  smaller
  656.           executable files.
  657.  
  658.           If you licensed the source code to GAPCDR, there are suplementary
  659.           files to aid in re-compiling and librarying the source modules.
  660.  
  661.           GAPCDR has  not been  tested with  Quick C,  although there is no
  662.           reason why it should not work with the QC environment.
  663.  
  664.           GAPCDR uses  the PASCAL  function calling  convention. If you are
  665.           unfamiliar  with  this  calling  convention  it  means  that  the
  666.           parameters to  a function  are pushed onto the stack from left to
  667.           right instead  of right  to left. In addition, the function being
  668.           called is  responsible for  removing arguments from the stack. In
  669.           the C  calling  convention,  the  function  making  the  call  is
  670.           responsible for  restoring the  stack. What  this means is if you
  671.           make 10  calls to show_mess, there will be 10 instances where the
  672.           stack must  be restored  upon return  from the  function. In  the
  673.           PASCAL convention,  there will  be only  one instance  where this
  674.           will occur  and it  will be in show_mess just prior to the actual
  675.           return. The  end result of using the PASCAL calling convention is
  676.           smaller code size.
  677.  
  678.           It should be noted that the PASCAL convention cannot be used with
  679.           functions that  take a variable number of arguments. In addition,
  680.           using  the   PASCAL  convention   absolutely  requires  that  all
  681.           functions be  prototyped. Otherwise  the compiler  will  generate
  682.           redeclaration errors  and the  linker  will  generate  unresolved
  683.           external reference errors.
  684.  
  685.  
  686.           Using A Goto          Using A Goto
  687.  
  688.           A word  about using  goto. If  you licensed  the source  code  to
  689.           GAPCDR, you  will find that we use the goto in several places. It
  690.           should be  pointed out  that speed and compactness, combined with
  691.           readability, are  our number  one concerns.  We performed several
  692.           experiments with  the goto.  We took  a very simple function that
  693.           consisted of  a while  loop and  a few statements embodied within
  694.           the loop.  We took  the same  function and  rewrote  it  using  a
  695.           counter variable  and a  goto and  removed the  while  loop.  The
  696.           assembler output  and resultant  object code  was 1/2 the size as
  697.           that of the function that used the while loop.
  698.  
  699.  
  700.  
  701.  
  702.                                        Page 13
  703.  
  704.  
  705.  
  706.           GAP Communications                                         GAPCDR
  707.  
  708.  
  709.           We are  not proposing that anyone give up the fine structure of C
  710.           and use  gotos as  a beginning  programmer in  Basic might do. In
  711.           fact, if  you are  a beginning  programmer in C, you should avoid
  712.           using gotos altogether until you become more proficient.
  713.  
  714.  
  715.           BBS System Files          BBS System Files
  716.  
  717.           Since we  are firm  believers that the BBS system files belong to
  718.           the BBS  and should  not be altered by any door program, updating
  719.           the BBS  system file  is not  automatic. If  you  wish  that  any
  720.           decrease or  increase in  the user's  time (kept  track of in the
  721.           timecredit  variable),   be  made   permanent,  you   may,  after
  722.           initializing the  door, call  the function  that opens the system
  723.           file. For  PCB, this would be PCBOARD.SYS. Keep track of any time
  724.           credits  during  the  door  programs  operation,  then  call  the
  725.           function that  updates the  BBS system  file. For  GAP, you would
  726.           need to re-write DOOR.SYS with any updated information.
  727.  
  728.  
  729.  
  730.           Sysop Setup And Functions          Sysop Setup And Functions
  731.  
  732.  
  733.           These sysop  setup and  function descriptions should be placed in
  734.           the documentation  of your  door program.  You should, of course,
  735.           change the setup information to fit your particular needs.
  736.  
  737.           Door programs  written with the GAPCDR Door Interface Module will
  738.           run on any BBS system that is capable of writing a DOOR.SYS file.
  739.           For GAP  Communications and  WildCat, you need do nothing special
  740.           when configuring your doors. These programs will write a DOOR.SYS
  741.           file automatically.  For PCBoard,  you must  explicitly tell  the
  742.           Door File  editor to  write a  DOOR.SYS file,  when setting  up a
  743.           GAPCDR door program.
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.                                        Page 14
  761.  
  762.  
  763.  
  764.           GAP Communications                                         GAPCDR
  765.  
  766.  
  767.           Configuration          Configuration
  768.  
  769.           To configure the door for a particular BBS setup, a configuration
  770.           file must  be used.  At the  very minimum, this file will contain
  771.           eight lines.  It may  contain more  than eight  depending upon  a
  772.           particular door's  configuration requirements.  The name  of  the
  773.           file is  usually the  same as that of the door program but with a
  774.           CNF extension.  The minimum  requirements for  the  file  are  as
  775.           follows:
  776.  
  777.                           c:\gap
  778.                           The Crow's Nest BBS
  779.                           IRQ
  780.                           Port Address
  781.                           Interface
  782.                           DigiBoard Window
  783.                           DigiBoard I/O Address
  784.                           DigiBoard Channel Number
  785.  
  786.  
  787.           The first  line is  the full  path to your BBS default directory.
  788.           For GAP, this is usually C:\GAP. For PCB, this is usually C:\PCB.
  789.           The second  line is  the name  of your BBS. The third line is the
  790.           IRQ that  should be used for the port, and the fourth line is the
  791.           Base Port Address. If you are just using Com 1 and Com 2, you may
  792.           enter a 0 on these two lines.
  793.  
  794.           Lines five through eight are for the Intelligent DigiBoard multi-
  795.           port Communications  Card. The  DigiBoard  routines  specifically
  796.           support the  COM/Xi series.  All four of these lines are required
  797.           even if  you are  using the  Standard Interface. Line five is the
  798.           Communications Port Interface. It must be one of the following:
  799.  
  800.                     STANDARD    DIGIBOARD   INT14/EBIOS
  801.  
  802.           The Standard  interface is the one that will normally be used. If
  803.           you  are   using  a   DigiBoard  then  either  the  DigiBoard  or
  804.           Int14/EBIOS interface  may be  selected. Most sysops will use the
  805.           Int14/EBIOS interface.  All  input/output  to  the  DigiBoard  is
  806.           performed via  Interrupt 14  calls and a Device Driver (available
  807.           from DigiBoard) handles the interface between the program and the
  808.           board. The  DigiBoard interface  uses Direct  Programming. GAPCDR
  809.           talks to the board directly without the need for a Device Driver.
  810.           In order  to use  this interface,  a program  called RESETDIG.EXE
  811.           must be used in the AUTOEXEC.BAT file to reset the DigiBoard once
  812.           when the  computer is  first booted.  If you  do  not  have  this
  813.           program (it is a part of the GAP Communications BBS package) then
  814.           the Int14/EBIOS interface must be used.
  815.  
  816.  
  817.  
  818.                                        Page 15
  819.  
  820.  
  821.  
  822.           GAP Communications                                         GAPCDR
  823.  
  824.  
  825.           If the  Interface is  other than STANDARD, then lines 6 through 8
  826.           will be  ignored. If  the Interface  is INT14/EBIOS, then lines 6
  827.           and 7 will be ignored.
  828.  
  829.           Line 6  is the  DigiBoard Memory Window, or the address the board
  830.           uses as  a  communications  area  between  itself  and  the  Host
  831.           Computer. This  line is  used only  if the  Interface is  set  to
  832.           DIGIBOARD. It  can be  set to  0 if  the Interface is STANDARD or
  833.           INT14/EBIOS.
  834.  
  835.           Line 7  is the DigiBoard I/O Port Address. This line is used only
  836.           if the  Interface is  set to  DIGIBOARD  and  can  be  set  to  0
  837.           otherwise.
  838.  
  839.           Line 8 is the DigiBoard Channel Number. This line is required for
  840.           the DIGIBOARD  and INT14/EBIOS  Interfaces. It  is normally 1 - 8
  841.           for the  DIGIBOARD Interface  and 4  -  11  for  the  INT14/EBIOS
  842.           Interface. The  Channel Number  is similar  to a  Port Number. It
  843.           tells the  program which of the DigiBoard Communications ports to
  844.           use.
  845.  
  846.           GAPCDR will obtain the sysop's name from the DOOR.SYS file.
  847.  
  848.           You must  now create  a batch file to invoke the door. This batch
  849.           file is  placed in  the directory  where you  told your BBS SetUp
  850.           program to look for it. Such a batch file might look like this:
  851.  
  852.  
  853.                           @echo off
  854.                           cd \gap\doors\tourist
  855.                           tourist tourist.cnf
  856.                           cd \gap
  857.  
  858.  
  859.           As you  can see, the door is invoked by passing the configuration
  860.           file name as  the first parameter.
  861.  
  862.           You will  also need  to modify your doors menu files and the data
  863.           file that  tells the  BBS what  your doors  are and  the security
  864.           level needed to access them. For GAP, these are respectively:
  865.  
  866.             DOORM
  867.             DOORMG
  868.             DOORS.DAT
  869.  
  870.           If you  are running  multi-nodes, simply  create a  separate door
  871.           configuration file  for each node, and number them. For instance,
  872.  
  873.  
  874.  
  875.  
  876.                                        Page 16
  877.  
  878.  
  879.  
  880.           GAP Communications                                         GAPCDR
  881.  
  882.  
  883.           for a  3 node  system, you might have the following configuration
  884.           files:
  885.  
  886.             TOURIST1.CNF
  887.             TOURIST2.CNF
  888.             TOURIST3.CNF
  889.  
  890.           The only difference between the three would be the 1st line which
  891.           points to the default directory for the particular node.
  892.  
  893.           Multi-user operation  is automatic.The  DOOR.SYS file  contains a
  894.           field that specifies if the BBS is multi-user or not.
  895.  
  896.  
  897.           Sysop Functions          Sysop Functions
  898.  
  899.           The  following  sysop  functions  are  available  while  awaiting
  900.           keyboard input :
  901.  
  902.             F5              - Shell to DOS.
  903.             F8              - Twit user and return to BBS.
  904.             F10             - Initiate chat with user.
  905.             CF10            - Answer user page bell.
  906.             Home            - Main user stats.
  907.             End             - Displays sysop keys available.
  908.             PgDn            - Secondary user stats.
  909.             Up Arrow        - Increase user's time remaining.
  910.             Dn Arrow        - Decrease user's time remaining.
  911.  
  912.  
  913.           One of  the nicer  features about using the TWIT key, is the user
  914.           is not  told that  "the sysop  wants them  to return to the BBS".
  915.           Instead, a very plain and simple message of "returning you to the
  916.           BBS" is displayed. This way, the user is given no indication that
  917.           the sysop is hovering about.
  918.  
  919.           When using  the F5  shell to  DOS key,  to  return  to  the  door
  920.           program, simply  type EXIT  at the  DOS command prompt. It is not
  921.           necessary to  change directories  back  to  the  door  directory.
  922.           GAPCDR is smart enough to know which drive and directory the door
  923.           program is  in and  will reset the defaults upon return from DOS.
  924.           In addition, the status line will remain on the screen.
  925.  
  926.           It should  be noted  that when  in a DOS shell, the GAPCDR status
  927.           line is  protected by  intercepting BIOS  video calls. If you use
  928.           ANSI.SYS replacements which write directly to the video, you will
  929.           not have this protection and your status line will scroll off the
  930.           screen
  931.  
  932.  
  933.  
  934.                                        Page 17
  935.  
  936.  
  937.  
  938.           GAP Communications                                         GAPCDR
  939.  
  940.  
  941.           The Up  and Down Arrow keys increase and decrease the user's time
  942.           respectively by  5 minutes for each press of the key. There is no
  943.           indication of  what is  occurring (except  by the fact the user's
  944.           time remaining  will change), so the sysop should try not to have
  945.           a lead  finger. The  increase or decrease is effective only while
  946.           the user  is in the door. Whether or not these time credits (plus
  947.           or minus)  are made  a permanent  part of the user record so that
  948.           upon return  from the  DOOR, the BBS program will recognize them,
  949.           depends upon the door author.
  950.  
  951.  
  952.  
  953.           Advanced Applications          Advanced Applications
  954.  
  955.  
  956.           GAPCDR includes a great many advanced functions which can be used
  957.           with or  without the  BBS Door  Interface (i.e., automatic status
  958.           line, time left checking, keyboard timeout checking, etc).
  959.  
  960.  
  961.           Communications          Communications
  962.  
  963.           The communications  functions are  an integral part of GAPCDR and
  964.           are called  automatically by  an output  routine if  the variable
  965.           local is  set to  0. However,  they may  be used  stand alone  or
  966.           called directly  if necessary.  These routines  are  fully  self-
  967.           contained with the exception of 3 global variables and 3 external
  968.           functions.
  969.  
  970.           The global variables are:
  971.  
  972.             baud            - Port speed
  973.             gotdv           - Flag signalling the presense of DESQview
  974.             port            - Communications Port Number
  975.  
  976.  
  977.           The external functions are:
  978.  
  979.             no_carrier      - Called if carrier is dropped
  980.             timer           - Time delay routine
  981.             dv_pause        - Called to give up time slice
  982.  
  983.  
  984.           Before  using   the  communications   routines  as   stand  alone
  985.           functions, you  should make  a call to dv_here so that it can set
  986.           the gotdv  flag. If  you are  not concerned about the presense of
  987.           DESQview, you must declare this variable and initialize it to 0:
  988.  
  989.  
  990.  
  991.  
  992.                                        Page 18
  993.  
  994.  
  995.  
  996.           GAP Communications                                         GAPCDR
  997.  
  998.  
  999.             short near gotdv = 0;
  1000.  
  1001.           Note that it must be declared such that it resides in the default
  1002.           data segment.  If you  declare the  variable yourself,  you  must
  1003.           insure that  the DESQVIEW.ASM  module is  not linked  in to  your
  1004.           program. You will need to create a dummy function called dv_pause
  1005.           that does  nothing but  return. This is necessary because even if
  1006.           you do  not wish  to use  the dv_pause  function, the linker will
  1007.           complain if it cannot find it:
  1008.  
  1009.             void _pascal dv_pause(void);
  1010.  
  1011.           Next, you  must set the variable port to the port number you will
  1012.           be using.  Ports start  at 0, where COM 1 equals Port 0. Then set
  1013.           the variable baud to the bps rate you want the port opened at.
  1014.  
  1015.           Your program  will need  to include a function called no_carrier.
  1016.           It is prototyped as:
  1017.  
  1018.             void _pascal no_carrier(void);
  1019.  
  1020.           This function  is called by the communications routines when they
  1021.           detect that  there is  no carrier.  You may  do whatever you wish
  1022.           inside this function but keep in mind that it will continue to be
  1023.           called if  there is no carrier on the port. You most certainly do
  1024.           not want  to make  calls to  any of  the communications functions
  1025.           from inside  this routine  or a  stack overflow  will  eventually
  1026.           result. If  you wish  to do  your own  carrier detecting  (as you
  1027.           would if  you were  going to be using these functions to create a
  1028.           dial out  type of program), then this function can simply contain
  1029.           a return.
  1030.  
  1031.           Once you  have the global variables configured, the first step in
  1032.           initializing the  serial port  is to  make  a  call  to  setport.
  1033.           Setport creates  the receive  buffer and  then sets up the serial
  1034.           port.  After  the  port  is  configured,  you  should  then  call
  1035.           init_port to  set the  baud, parity,  and  data  bits.  Init_port
  1036.           supports all  the baud  rates that  a UART  on  an  IBM  type  of
  1037.           computer is  capable of  utilizing. After  this the port is fully
  1038.           configured and may now be utilized. Before your program ends, you
  1039.           must call reset_port to restore the interrupt vector back the way
  1040.           it was.
  1041.  
  1042.           The main input routines are:
  1043.  
  1044.             comgetc         - Get a single character from the port
  1045.             comgetd         - Get a character with timeout
  1046.  
  1047.  
  1048.  
  1049.  
  1050.                                        Page 19
  1051.  
  1052.  
  1053.  
  1054.           GAP Communications                                         GAPCDR
  1055.  
  1056.  
  1057.           The main output routines are:
  1058.  
  1059.             computc         - Send a single character
  1060.             computs         - Send a string
  1061.  
  1062.  
  1063.           There are  routines for checking carrier, turning DTR on and off,
  1064.           checking if  there are  any characters in the receive buffer, and
  1065.           clearing the receive buffer.
  1066.  
  1067.           If you  need to change baud rates simple set the variable baud to
  1068.           whatever bps rate you want to change to and then call init_port.
  1069.  
  1070.  
  1071.           DOS Window          DOS Window
  1072.  
  1073.           GAPCDR includes  some very advanced functions for setting up what
  1074.           we call  a DOS  Window. This  is a  Window that you define on the
  1075.           local screen  and to which all DOS output will be redirected. For
  1076.           instance, if  you needed  to shell  to DOS to run PKUNZIP or DSZ,
  1077.           you could  set up  a DOS  Window and  all output  from these  two
  1078.           programs will be contained inside the window. The window can also
  1079.           be used  without shelling  to DOS  although there  is  really  no
  1080.           practical use for doing so.
  1081.  
  1082.           To set  up a  DOS window, the first thing you should do is make a
  1083.           call to  get_attr so that the current screen colors can be stored
  1084.           away. This  is necessary  because you  may want  to  use  special
  1085.           colors in  your  DOS  window.  By  storing  the  original  screen
  1086.           attributes, they  can be  restored when  you  close  the  window,
  1087.           thereby keeping  the user's  screen colors the way the user likes
  1088.           them!
  1089.  
  1090.           At the  beginning of  your program  call get_attr. Do this before
  1091.           you do any screen output. You will then make several calls to the
  1092.           various GAPCDR  functions to  setup your  DOS window.  Once it is
  1093.           configured, you  can then  shell to DOS and do whatever you like.
  1094.           All screen  output will take place inside the window. Please note
  1095.           that if  you use a console driver other than CON or ANSI.SYS (and
  1096.           this generally  includes all  so called video speed up programs),
  1097.           or run  a program that writes directly to the screen, then output
  1098.           will not  take place  inside of the window. This is because video
  1099.           speed up  programs generally write directly to the screen instead
  1100.           of using the BIOS.
  1101.  
  1102.           To see  how the  DOS window works, after setting it up, issue the
  1103.           following call:
  1104.  
  1105.  
  1106.  
  1107.  
  1108.                                        Page 20
  1109.  
  1110.  
  1111.  
  1112.           GAP Communications                                         GAPCDR
  1113.  
  1114.  
  1115.             system("COMMAND");
  1116.  
  1117.           This will  put you  in a  DOS shell. You may then execute various
  1118.           DOS functions  and get  a feel for what it looks like. Be sure to
  1119.           type "exit" to return to your program.
  1120.  
  1121.           When you no longer need the DOS window, it is imperitive that you
  1122.           remove the  interrupt 10 (BIOS) intercepter or your computer will
  1123.           hang when you exit the program.
  1124.  
  1125.           There is  a fully  working example  of a  DOS Window in the CDOOR
  1126.           example program.  It shows  how to  save a portion of the screen,
  1127.           draw a box, set up the interrupt 10 intercepter and shell to DOS.
  1128.           Upon return from the shell, it will remove the DOS Window.
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.                                        Page 21
  1167.  
  1168.  
  1169.  
  1170.           GAP Communications                                         GAPCDR
  1171.  
  1172.  
  1173.           Variables          Variables
  1174.  
  1175.  
  1176.  
  1177.           Defines          Defines
  1178.  
  1179.           The following defines are used when calling show_mess.
  1180.  
  1181.             NO           - Defined as 0
  1182.             YES          - Defined as 1
  1183.  
  1184.           Ansi Variables          Ansi Variables
  1185.  
  1186.           ANSI strings contain the actual ANSI color sequences.
  1187.  
  1188.             A_BLACK      - ANSI codes for Black
  1189.             A_BLUE       - ANSI codes for Blue
  1190.             A_BROWN      - ANSI codes for Brown
  1191.             A_CYAN       - ANSI codes for Cyan
  1192.             A_GREEN      - ANSI codes for Green
  1193.             A_MAGENTA    - ANSI codes for Magenta
  1194.             A_RED        - ANSI codes for Red
  1195.             A_WHITE      - ANSI codes for White
  1196.  
  1197.  
  1198.             A_BBLACK     - ANSI codes for Grey
  1199.             A_BBLUE      - ANSI codes for bright Blue
  1200.             A_BCYAN      - ANSI codes for bright Cyan
  1201.             A_BGREEN     - ANSI codes for bright Green
  1202.             A_BMAGENTA   - ANSI codes for bright Magenta
  1203.             A_BRED       - ANSI codes for bright Red
  1204.             A_BWHITE     - ANSI codes for bright White
  1205.             A_YELLOW     - ANSI codes for Yellow
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.                                        Page 22
  1225.  
  1226.  
  1227.  
  1228.           GAP Communications                                         GAPCDR
  1229.  
  1230.  
  1231.           DOOR.SYS Variables          DOOR.SYS Variables
  1232.  
  1233.           DOOR.SYS variables  are initialized  while reading  the  DOOR.SYS
  1234.           file. These variables are the door programmer's connection to the
  1235.           BBS.
  1236.  
  1237.  
  1238.           Short Integers          Short Integers
  1239.  
  1240.             alarm        - 0 = caller alarm off, 1 = on
  1241.             baud         - DTE bps rate (unsigned)
  1242.             bell         - 0 = page bell off, 1 = bell on
  1243.             color        - 0 = no color, 1 = color
  1244.             curfiles     - current files downloaded
  1245.             dflt_color   - BBS default color
  1246.             digiseg      - DigiBoard Memory Window
  1247.             digiport     - DigiBoard I/O Port
  1248.             digichnl     - DigiBoard Channel #
  1249.             expert       - 0 = novice, 1 = expert
  1250.             interface    - 0 = Standard, 1 = DigiBoard, 2 = INT14/EBIOS
  1251.             level        - user's security level
  1252.             local        - 0 = remote user, 1 = local user
  1253.             maxfiles     - max files available
  1254.             minsleft     - minutes left at door start
  1255.             multi        - 1 = system is multi-user
  1256.             node         - node number in use, 0 = single
  1257.             page         - page length
  1258.             parity       - actually data bits, not used
  1259.             port         - com port being used
  1260.             printer      - 0 = printer off, 1 = printer on
  1261.             realcredit   - time credits from the BBS
  1262.             screen       - 0 = screen off, 1 = screen on
  1263.             userbaud     - remote user's bps rate (unsigned)
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.                                        Page 23
  1283.  
  1284.  
  1285.  
  1286.           GAP Communications                                         GAPCDR
  1287.  
  1288.  
  1289.           Long Integers          Long Integers
  1290.  
  1291.             curbytes     - current download bytes
  1292.             doors_open   - total doors opened
  1293.             downbytes    - total download bytes
  1294.             downloads    - total number of downloads
  1295.             maxbytes     - max bytes can download
  1296.             mesleft      - total messages left
  1297.             recnum       - user's record number
  1298.             timeson      - # of times on
  1299.             upbytes      - total upload bytes
  1300.             uploads      - total number of uploads
  1301.  
  1302.           Character Arrays          Character Arrays
  1303.  
  1304.             bphone       - user's business phone number
  1305.             city         - user's home town
  1306.             event_time   - event run time
  1307.             fname        - user's first name
  1308.             handle       - caller's Handle
  1309.             hphone       - user's home phone number
  1310.             last_new     - last new files scan
  1311.             lastdate     - last date user was on
  1312.             lname        - user's last name
  1313.             password     - user's password
  1314.             subscrip     - date user's subscription expires
  1315.             username     - user's full name
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.                                        Page 24
  1341.  
  1342.  
  1343.  
  1344.           GAP Communications                                         GAPCDR
  1345.  
  1346.  
  1347.           Global Variables          Global Variables
  1348.  
  1349.           These variables are the documented, global variables (initialized
  1350.           and used  by GAPCDR).  They may  be modified  and/or used  at the
  1351.           programmer's discretion.
  1352.  
  1353.  
  1354.           Characters          Characters
  1355.  
  1356.             chat         - true if chatting with user
  1357.             clockon      - 0 no clock, 1 display clock
  1358.             column       - column we are at now
  1359.             endview      - true if dont want to viewany more
  1360.             flag         - flag that a space was pressed
  1361.             instatus     - if doing status line
  1362.             noup         - if 1, dont uppercase characters
  1363.             NS           - true if in Non Stop mode
  1364.             redisplay    - true if wants to start over
  1365.             usemore1     - true if showing a file
  1366.             view         - true to use the more prompt
  1367.             wordwrap     - column to wrap words at
  1368.  
  1369.           Short Integers          Short Integers
  1370.  
  1371.             base_add     - base address for port
  1372.             irq          - IRQ for port
  1373.             lines        - # of lines currently displayed
  1374.             normal       - current display color
  1375.             timecredit   - any time credits user may have
  1376.             timeleft     - time user has left
  1377.  
  1378.           Long Integers          Long Integers
  1379.  
  1380.             starttime    - time door opened
  1381.             temptime     - for calculating time out
  1382.             timenow      - current time
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.                                        Page 25
  1399.  
  1400.  
  1401.  
  1402.           GAP Communications                                         GAPCDR
  1403.  
  1404.  
  1405.           Character Arrays          Character Arrays
  1406.  
  1407.             anystring    - global garbage collector
  1408.             bbs_dir      - path to DOOR.SYS
  1409.             birthday     - caller's birth date
  1410.             board_name   - name of the BBS
  1411.             BS           - backspace characters
  1412.             CRLF         - carriage return/line feed characters
  1413.             curtime      - holds the current time as a string
  1414.             gendir       - path to the BBS gen dir
  1415.             maindir      - path to the BBS main dir
  1416.             strtime      - holds the time string
  1417.             sysname      - sysop's name
  1418.  
  1419.           Structures          Structures
  1420.  
  1421.             GAP_USER user     - GAP's User Record
  1422.             PCBSYS pcbsys     - PCB's System Record
  1423.             PCBUSER pcbuser   - PCB's User Record
  1424.  
  1425.  
  1426.           These structures are fully commented in the GAPCDR.H header file.
  1427.           Note that  when utilizing  the GAP  user  structure,  all  string
  1428.           fields are fully padded with spaces and the last position must be
  1429.           a 0.
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.                                        Page 26
  1457.  
  1458.  
  1459.  
  1460.           GAP Communications                                         GAPCDR
  1461.  
  1462.  
  1463.           Functions - Quick Reference          Functions - Quick Reference
  1464.  
  1465.  
  1466.             access1         - Checks for the existence of a file.
  1467.             ansi            - Displays ANSI color strings.
  1468.             backspace       - Sends one or more backspaces.
  1469.             ckeypress       - Checks for a remote or local key press.
  1470.             clear_scrn      - Clears the local and remote screens.
  1471.             clr_buf         - Cleare the communications receive buffer.
  1472.             cls             - Clears the 1st 23 lines on the local screen.
  1473.             cls_all         - Clears the entire local screen.
  1474.             comgetc         - Gets a character from com port.
  1475.             comgetd         - Geta a character from com port with timeout.
  1476.             computb         - Sends a buffer of data to com port.
  1477.             computc         - Sends a character to com port.
  1478.             computs         - Sends a string to com port.
  1479.             cursoff         - Turns local cursor off.
  1480.             curson          - Turns local cursor on.
  1481.             do_chat         - To allow sysop to chat with remote user.
  1482.             dtr             - Toggels the DTR line on or off.
  1483.             dv_here         - Checks for the presense of DESQView.
  1484.             dv_pause        - Gives up remainder of time slice to DV.
  1485.             elap_time       - Computes elapsed time.
  1486.             empty           - Empties a string.
  1487.             fix_color       - Modifies ANSI driver for color or mono.
  1488.             gapputc         - Sends a character to local and remote.
  1489.             gapputs         - Sends a string to local and remote screens.
  1490.             getakey         - Gets one key responses.
  1491.             getkeyc         - Gets keyboard character and scan code.
  1492.             get_attr        - Gets startup video attribute.
  1493.             get_random      - Returns a random number.
  1494.             get_string      - Gets a string of characters.
  1495.             init_ansi       - Initializes ANSI driver.
  1496.             init_com        - Initializes Communications Port.
  1497.             init_door       - Initializes the Door.
  1498.             init_port       - Sets up Communications Port.
  1499.             iscd            - Checks if there is a Carrier.
  1500.             leave           - Shuts down door and returns to the BBS.
  1501.             lputc           - Sends a character to local screen.
  1502.             lputs           - Sends a string to local screen.
  1503.             make_sound      - Makes noise on local computer.
  1504.             more            - Checks for a full screen.
  1505.             nl              - Sends a CR/LF to local and remote.
  1506.             no_carrier      - Called by the Comm Routines if Carrier lost.
  1507.             pagesysop       - Alerts sysop that the user wants to chat.
  1508.             pause           - Sends a "Press [Any Key] To Continue" prompt.
  1509.             putkey          - Used by chat for word wrapping.
  1510.             read_cnf        - Reads the door configuration file.
  1511.  
  1512.  
  1513.  
  1514.                                        Page 27
  1515.  
  1516.  
  1517.  
  1518.           GAP Communications                                         GAPCDR
  1519.  
  1520.  
  1521.             read_doorsys    - Reads DOOR.SYS.
  1522.             read_gapuser    - Reads USERS.DAT.
  1523.             read_pcbsys     - Reads PCBOARD.SYS.
  1524.             read_pcbuser    - Reads PCB USERS file.
  1525.             read_score      - Reads and displays top 10 scores.
  1526.             reset_port      - Restores Communications Port.
  1527.             restore_screen  - Restores a portion of the screen.
  1528.             rest_cbreak     - Restores Ctrl-Break vector.
  1529.             rest_int10      - Restores BIOS vector.
  1530.             rts             - Toggels RTS line on or off.
  1531.             rxempty         - Checks if any characters in receive buffer.
  1532.             save_screen     - Saves a portion of the screen.
  1533.             setport         - Initializes Communications port.
  1534.             set_attr        - Sets video attributes.
  1535.             set_cbreak      - Initializes Ctrl-Break vector.
  1536.             set_cord        - Sets up a DOS Window.
  1537.             set_int10       - Initializes BIOS trapper.
  1538.             set_status      - Displays status line.
  1539.             show_file       - Displays text files.
  1540.             show_mess       - Displays a message.
  1541.             timer           - Time Delay.
  1542.             time_credit     - Gives credits for time used.
  1543.             time_left       - Computes time remaining.
  1544.             trim            - Trims spaces from string.
  1545.             update_clock    - Updates status line clock.
  1546.             wrap_word       - Wraps a word.
  1547.             write_gapuser   - Writes USERS.DAT.
  1548.             write_pcbsys    - Writes PCBOARD.SYS.
  1549.             write_pcbuser   - Writes PCB USERS.
  1550.             write_score     - Creates and maintains top 10 scores file.
  1551.  
  1552.  
  1553.           Functions - Detailed Reference          Functions - Detailed Reference
  1554.  
  1555.  
  1556.           Functions will  return either a void (nothing), a short value, or
  1557.           a character pointer.
  1558.  
  1559.           The function  descriptions will note whether or not a function is
  1560.           high level  or low  level. The high level functions are basically
  1561.           the only  functions you  will ever  need to  use. When necessary,
  1562.           they will  call other  functions to carry out their work. The low
  1563.           level functions,  on the other hand, are more single purpose, and
  1564.           they generally  require calls  to other  low level  functions  to
  1565.           perform the same task as one call to a high level function.
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.                                        Page 28
  1573.  
  1574.  
  1575.  
  1576.           GAP Communications                                         GAPCDR
  1577.  
  1578.  
  1579.           access1
  1580.           -----------------------------------------------------------------
  1581.  
  1582.           Purpose       Checks for the existence of a file.
  1583.  
  1584.                         short access1(char *filename);
  1585.  
  1586.                         filename   Full path and name of file
  1587.  
  1588.           Type          High Level
  1589.  
  1590.           Description   This function is used to check for the existence of
  1591.                         a file. It works in a multi-user environment and is
  1592.                         not affected by file sharing attributes.
  1593.  
  1594.           Return Value  0 = File exists, 1 = File not found.
  1595.  
  1596.           Example
  1597.  
  1598.              if ((access1("FILE.DAT")))
  1599.                show_mess("Sorry, File does not Exist!", YES,YES);
  1600.  
  1601.  
  1602.           ansi
  1603.           -----------------------------------------------------------------
  1604.  
  1605.           Purpose       Displays ANSI color sequences.
  1606.  
  1607.                         void ansi(char *color);
  1608.  
  1609.                         color      Ansi color string
  1610.  
  1611.           Type          High Level
  1612.  
  1613.           Description   This function  will send  a string  of ANSI  escape
  1614.                         sequences to  the remote  user  and  to  the  local
  1615.                         console. The  ANSI codes for the various colors are
  1616.                         declared as  global variables.  If  the  remote  or
  1617.                         local user  is in  non graphics  mode, the function
  1618.                         returns immediately.
  1619.  
  1620.           Return Value  None.
  1621.  
  1622.           Example       ansi(A_BWHITE); // Change color to bright white
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.                                        Page 29
  1631.  
  1632.  
  1633.  
  1634.           GAP Communications                                         GAPCDR
  1635.  
  1636.  
  1637.           backspace
  1638.           -----------------------------------------------------------------
  1639.  
  1640.           Purpose       Sends one or more backspaces.
  1641.  
  1642.                         void backspace(short num);
  1643.  
  1644.                         num        Number of backspaces to send
  1645.  
  1646.           Type          High Level
  1647.  
  1648.           Description   In order  to actually  erase  a  character  on  the
  1649.                         screen, you  must send a 3 character sequence which
  1650.                         consists  of   backspace,  space,  backspace.  This
  1651.                         function will  send as  many of  these 3  character
  1652.                         sequences as you specify in the parameter list.
  1653.  
  1654.           Return Value  None.
  1655.  
  1656.           Example       backspace(1);     // erase last character sent
  1657.  
  1658.  
  1659.  
  1660.           ckeypress
  1661.           -----------------------------------------------------------------
  1662.  
  1663.           Purpose       Checks for a remote or local key press.
  1664.  
  1665.                         short ckeypress(void);
  1666.  
  1667.           Type          High Level
  1668.  
  1669.           Description   This function will check the local keyboard as well
  1670.                         as the  communications receive  buffer to  see if a
  1671.                         key is waiting to be read. It is most often used in
  1672.                         loops   that   monitor   keyboard   timeout,   time
  1673.                         remaining, etc.
  1674.  
  1675.           Return Value  0 = no key is waiting, 1 = a key is waiting.
  1676.  
  1677.           Example       c = ckeypress();  // key pressed?
  1678.  
  1679.              while(!ckeypress())          // do nothing
  1680.                {                          // until a key is pressed
  1681.                dv_pause()                 // give up time slice
  1682.                }
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.                                        Page 30
  1689.  
  1690.  
  1691.  
  1692.           GAP Communications                                         GAPCDR
  1693.  
  1694.  
  1695.           clear_scrn
  1696.           -----------------------------------------------------------------
  1697.  
  1698.           Purpose       Clears local and remote screens.
  1699.  
  1700.                         void clear_scrn(void);
  1701.  
  1702.           Type          High Level
  1703.  
  1704.           Description   This routine  will use the assembler routine cls to
  1705.                         clear the  first 23  lines of  the local screen. If
  1706.                         the remote  caller is in non-color mode, it sends a
  1707.                         CTRL-L to the remote screen, otherwise it sends the
  1708.                         ANSI clear screen sequence.
  1709.  
  1710.           Return Value  None.
  1711.  
  1712.           Example       clear_scrn();     // clear screen
  1713.  
  1714.  
  1715.  
  1716.           clr_buf
  1717.           -----------------------------------------------------------------
  1718.  
  1719.           Purpose       Clears the Communications receive buffer.
  1720.  
  1721.                         void clr_buf(void);
  1722.  
  1723.           Type          Low Level
  1724.  
  1725.           Description   Empties the  receive buffer  such that  any pending
  1726.                         characters are simply ignored.
  1727.  
  1728.           Return Value  None.
  1729.  
  1730.           Example       clr_buf();      // clear the receive buffer
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746.                                        Page 31
  1747.  
  1748.  
  1749.  
  1750.           GAP Communications                                         GAPCDR
  1751.  
  1752.  
  1753.           cls
  1754.           -----------------------------------------------------------------
  1755.  
  1756.           Purpose       Clears the first 23 lines on the local screen.
  1757.  
  1758.                         void cls(void);
  1759.  
  1760.           Type          Low Level
  1761.  
  1762.           Description   This function  will clear the first 23 lines on the
  1763.                         local  screen,  thereby  protecting  the  bottom  2
  1764.                         lines.
  1765.  
  1766.           Return Value  None.
  1767.  
  1768.           Example       cls();          // clear 1st 23 lines
  1769.  
  1770.  
  1771.  
  1772.           cls_all
  1773.           -----------------------------------------------------------------
  1774.  
  1775.           Purpose       Clears the entire local screen.
  1776.  
  1777.                         void cls_all(void);
  1778.  
  1779.           Type          Low Level
  1780.  
  1781.           Description   This function  will clear  the entire local screen.
  1782.                         It is used by leave to tidy up the screen.
  1783.  
  1784.           Return Value  None.
  1785.  
  1786.           Example       cls_all();      // clear entire screen
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800.  
  1801.  
  1802.  
  1803.  
  1804.                                        Page 32
  1805.  
  1806.  
  1807.  
  1808.           GAP Communications                                         GAPCDR
  1809.  
  1810.  
  1811.           comgetc
  1812.           -----------------------------------------------------------------
  1813.  
  1814.           Purpose       Retrieve a character from communications buffer.
  1815.  
  1816.                         short comgetc(void);
  1817.  
  1818.           Type          Low Level
  1819.  
  1820.           Description   Checks  the   communications  receive   buffer  and
  1821.                         returns the next character, if any.
  1822.  
  1823.           Return Value  Next character in buffer or -1 for no characters to
  1824.                         read.
  1825.  
  1826.           Example       c = comgetc();    // get a character from remote
  1827.  
  1828.  
  1829.  
  1830.           comgetd
  1831.           -----------------------------------------------------------------
  1832.  
  1833.           Purpose       Retrieve a  character  from  comminications  buffer
  1834.                         with delay.
  1835.  
  1836.                         short comgetd(short secs);
  1837.  
  1838.                         secs       Number of seconds to wait
  1839.  
  1840.           Type          Low level
  1841.  
  1842.           Description   This function  is the  same as comgetc, except that
  1843.                         if there  are no  characters in the receive buffer,
  1844.                         it will wait for the number of seconds you specify.
  1845.                         Comgetd is  fully DESQview  aware and  will give up
  1846.                         the program's time slice while waiting for incoming
  1847.                         characters.
  1848.  
  1849.           Return Value  Next character  in buffer  or -10  for time-out (no
  1850.                         characters to read).
  1851.  
  1852.           Example
  1853.  
  1854.              if ( (comgetd(2)) == -10)    // wait for 2 seconds
  1855.                ;                          // nothing happening
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.  
  1862.                                        Page 33
  1863.  
  1864.  
  1865.  
  1866.           GAP Communications                                         GAPCDR
  1867.  
  1868.  
  1869.           computb
  1870.           -----------------------------------------------------------------
  1871.  
  1872.           Purpose       Sends a buffer of data out the communications port.
  1873.  
  1874.                         void computb(char *buffer,short len);
  1875.  
  1876.                         buffer     Buffer containing data to send
  1877.                         len        Number of bytes to send
  1878.  
  1879.           Type          Low Level
  1880.  
  1881.           Descripton    This function  will send  a user  suplied buffer of
  1882.                         len bytes  out the communications port, one byte at
  1883.                         a time.  It will  not return  until all  characters
  1884.                         have been sent.
  1885.  
  1886.           Return Value  None.
  1887.  
  1888.           Example       computb(buffer,100); // Send 100 bytes of data
  1889.  
  1890.  
  1891.  
  1892.           computc
  1893.           -----------------------------------------------------------------
  1894.  
  1895.           Purpose       Sends a  single character  out  the  communications
  1896.                         port.
  1897.  
  1898.                         void computc(unsigned char ch);
  1899.  
  1900.                         ch         Character to send
  1901.  
  1902.           Type          Low Level
  1903.  
  1904.           Description   Will send a single character out the communications
  1905.                         port.
  1906.  
  1907.           Return Value  None.
  1908.  
  1909.           Example       computc('A');     // Send a character
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.                                        Page 34
  1921.  
  1922.  
  1923.  
  1924.           GAP Communications                                         GAPCDR
  1925.  
  1926.  
  1927.           computs
  1928.           -----------------------------------------------------------------
  1929.  
  1930.           Purpose       Sends a string of characters out the communications
  1931.                         port.
  1932.  
  1933.                         void computs(char *str);
  1934.  
  1935.                         str        String to send
  1936.  
  1937.           Type          Low Level
  1938.  
  1939.           Description   Will  send   a  string   of  characters   out   the
  1940.                         communications port.  Note that unlike computb, the
  1941.                         number of bytes to send is determined by the length
  1942.                         of  the   string.  Therefore  this  function  stops
  1943.                         sending characters  when  it  encounters  the  null
  1944.                         byte.
  1945.  
  1946.           Return Value  None.
  1947.  
  1948.           Example       computs("Send this string");   // send a string
  1949.  
  1950.  
  1951.  
  1952.           cursoff
  1953.           -----------------------------------------------------------------
  1954.  
  1955.           Purpose       Turns the local cursor off.
  1956.  
  1957.                         void cursoff(void);
  1958.  
  1959.           Type          Low Level
  1960.  
  1961.           Description   This function  is used  to turn  the cursor  on the
  1962.                         local monitor off.
  1963.  
  1964.           Return Value  None.
  1965.  
  1966.           Example       cursoff();      // turn the cursor off
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.                                        Page 35
  1979.  
  1980.  
  1981.  
  1982.           GAP Communications                                         GAPCDR
  1983.  
  1984.  
  1985.           curson
  1986.           -----------------------------------------------------------------
  1987.  
  1988.           Purpose       Turns the local cursor on.
  1989.  
  1990.                         void curson(void);
  1991.  
  1992.           Type          Low Level
  1993.  
  1994.           Description   This function  is used  to turn  the cursor  on the
  1995.                         local monitor on.
  1996.  
  1997.           Return Value  None.
  1998.  
  1999.           Example       curson();       // turn the cursor on
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.                                        Page 36
  2037.  
  2038.  
  2039.  
  2040.           GAP Communications                                         GAPCDR
  2041.  
  2042.  
  2043.           do_chat
  2044.           -----------------------------------------------------------------
  2045.  
  2046.           Purpose       To allow sysop to chat with remote user.
  2047.  
  2048.                         void do_chat(void);
  2049.  
  2050.           Type          High Level
  2051.  
  2052.           Description   This function  allows a  one on one chat with a re-
  2053.                         mote user.  If the  caller is in graphics mode, the
  2054.                         sysop's key  presses will be displayed in green and
  2055.                         the remote  user's key presses will be displayed in
  2056.                         white. Text  will automatically  wrap at column 76.
  2057.                         To exit  chat, press  either the  ESC key or type a
  2058.                         CTRL-X. Note  that the  user may  also  send  these
  2059.                         characters to  end chat. The user will receive full
  2060.                         credit for  the time spent chatting with the sysop.
  2061.                         However, this  function will  not  update  the  BBS
  2062.                         system file  so it is possible that the user may be
  2063.                         logged off  (with an  out  of  time  message)  when
  2064.                         he/she returns to the BBS.
  2065.  
  2066.           Return Value  None.
  2067.  
  2068.           Example       do_chat();        // chat with caller
  2069.  
  2070.              empty(response,1);           // initialize string
  2071.  
  2072.              get_string(response);        // get a string
  2073.  
  2074.              if (response[0] == 'P')      // paging sysop
  2075.                do_chat();                 // chat with sysop
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.                                        Page 37
  2095.  
  2096.  
  2097.  
  2098.           GAP Communications                                         GAPCDR
  2099.  
  2100.  
  2101.           dtr
  2102.           -----------------------------------------------------------------
  2103.  
  2104.           Purpose       Toggle the DTR line on and off.
  2105.  
  2106.                         void dtr(short how)
  2107.  
  2108.                         how        0 = Turn DTR off.
  2109.                                    1 = Turn DTR on
  2110.  
  2111.           Type          Low Level
  2112.  
  2113.           Description   This routine  is used  to turn  the DTR line of the
  2114.                         communications port  on or  off.  Turning  DTR  off
  2115.                         while there  is a  carrier will  cause the modem to
  2116.                         drop carrier on the remote caller. In order to send
  2117.                         commands to the modem, DTR needs to be on.
  2118.  
  2119.           Return Value  None.
  2120.  
  2121.           Example
  2122.  
  2123.              dtr(1);                         // turn DTR on
  2124.              computs("ATZ");                 // reset the modem
  2125.  
  2126.  
  2127.  
  2128.  
  2129.  
  2130.  
  2131.  
  2132.  
  2133.  
  2134.  
  2135.  
  2136.  
  2137.  
  2138.  
  2139.  
  2140.  
  2141.  
  2142.  
  2143.  
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.                                        Page 38
  2153.  
  2154.  
  2155.  
  2156.           GAP Communications                                         GAPCDR
  2157.  
  2158.  
  2159.           dv_here
  2160.           -----------------------------------------------------------------
  2161.  
  2162.           Purpose       Checks to  see if  the  program  is  running  under
  2163.                         DESQview.
  2164.  
  2165.                         short dv_here(void);
  2166.  
  2167.           Type          Low Level
  2168.  
  2169.           Description   This function  should generally  be called  when  a
  2170.                         program first  starts (before  any screen output is
  2171.                         performed). It  makes a  special DOS call to see if
  2172.                         DESQview is  installed. If  so, it sets an internal
  2173.                         flag indicating  the presense of DV. If the program
  2174.                         is detected  to be  running under DESQview then all
  2175.                         "do nothing"  loops (those  loops that  are looking
  2176.                         for something  to do  but because  they are waiting
  2177.                         for keyboard  or com input, are basically taking up
  2178.                         computer time  doing nothing),  will  give  up  the
  2179.                         remainder of their time slice after they figure out
  2180.                         there is  nothing for  them  to  do.  In  addition,
  2181.                         because the built in ANSI driver writes directly to
  2182.                         the screen, if DESQview is present, the driver will
  2183.                         instead write  to DV's  video shadow  buffer.  This
  2184.                         function is automatically called by init_door so it
  2185.                         is not necessary to call it again.
  2186.  
  2187.           Return Value  DESQview version number or 0 for not installed.
  2188.  
  2189.           Example
  2190.  
  2191.              if ( (dv_here()))
  2192.                show_mess("We are running under DESQview!", NO,YES);
  2193.  
  2194.  
  2195.  
  2196.  
  2197.  
  2198.  
  2199.  
  2200.  
  2201.  
  2202.  
  2203.  
  2204.  
  2205.  
  2206.  
  2207.  
  2208.  
  2209.  
  2210.                                        Page 39
  2211.  
  2212.  
  2213.  
  2214.           GAP Communications                                         GAPCDR
  2215.  
  2216.  
  2217.           dv_pause
  2218.           -----------------------------------------------------------------
  2219.  
  2220.           Purpose       Give up remainder of time slice to DESQview.
  2221.  
  2222.                         void dv_pause(void);
  2223.  
  2224.           Type          Low Level
  2225.  
  2226.           Description   If DESQview is installed, this function will make a
  2227.                         call to  DV such that DV will immediately switch to
  2228.                         another task.  Note that  dv_here must be called at
  2229.                         the beginning  of the  program  since  it  sets  an
  2230.                         internal variable  that this function checks to see
  2231.                         if DESQview is running.
  2232.  
  2233.                         You should  use this  function inside  of  all  "do
  2234.                         nothing" loops.
  2235.  
  2236.           Return Value  None.
  2237.  
  2238.           Example
  2239.  
  2240.              time (&temptime);            // start timer
  2241.  
  2242.              while (!getakey())           // until a key is pressed
  2243.                {
  2244.                elap_time();               // check time remaining
  2245.                dv_pause();                // give up time slice
  2246.                }
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.  
  2253.  
  2254.  
  2255.  
  2256.  
  2257.  
  2258.  
  2259.  
  2260.  
  2261.  
  2262.  
  2263.  
  2264.  
  2265.  
  2266.  
  2267.  
  2268.                                        Page 40
  2269.  
  2270.  
  2271.  
  2272.           GAP Communications                                         GAPCDR
  2273.  
  2274.  
  2275.           elap_time
  2276.           -----------------------------------------------------------------
  2277.  
  2278.           Purpose       Computes elapsed  time while  waiting for  keyboard
  2279.                         input.
  2280.  
  2281.                         void elap_time(void);
  2282.  
  2283.           Type          High Level
  2284.  
  2285.           Description   This function  is used  in loops  that await a key-
  2286.                         board response.  Prior to  entering the  loop,  the
  2287.                         variable called temptime should be initialized with
  2288.                         the  current  time.  Once  inside  the  loop,  this
  2289.                         function should  be called  to keep  track  of  the
  2290.                         elapsed time.  If there  is  no  keyboard  response
  2291.                         within 4 minutes, the user will be logged off.
  2292.  
  2293.           Return Value  None.
  2294.  
  2295.           Example
  2296.  
  2297.              time (&temptime);            // start timer
  2298.  
  2299.              while (!getakey())           // until a key is pressed
  2300.                {
  2301.                elap_time();               // check time remaining
  2302.                dv_pause();                // give up time slice
  2303.                }
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320.  
  2321.  
  2322.  
  2323.  
  2324.  
  2325.  
  2326.                                        Page 41
  2327.  
  2328.  
  2329.  
  2330.           GAP Communications                                         GAPCDR
  2331.  
  2332.  
  2333.           empty
  2334.           -----------------------------------------------------------------
  2335.  
  2336.           Purpose       Empties a string to all spaces.
  2337.  
  2338.                         void empty(char *str,short len);
  2339.  
  2340.                         str        The string to be emptied
  2341.                         len        Number of bytes to clear
  2342.  
  2343.           Type          High Level
  2344.  
  2345.           Description   Before using  the string input routine, get_string,
  2346.                         the string  must first  be cleared  to the  maximum
  2347.                         number of  bytes allowed  to be input. Empty clears
  2348.                         the string  to all  spaces and  adds a null byte at
  2349.                         the end.  The null  byte is  not counted in the len
  2350.                         parameter.
  2351.  
  2352.           Return Value  None.
  2353.  
  2354.           Example
  2355.  
  2356.              char instr [11];
  2357.  
  2358.              empty(instr,10);             // empty the string
  2359.              get_string(instr);           // get up to 10 characters
  2360.                                           // of input
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.                                        Page 42
  2385.  
  2386.  
  2387.  
  2388.           GAP Communications                                         GAPCDR
  2389.  
  2390.  
  2391.           fix_color
  2392.           -----------------------------------------------------------------
  2393.  
  2394.           Purpose       Modify ANSI driver according to user's color.
  2395.  
  2396.                         void fix_color(void);
  2397.  
  2398.           Type          Low Level
  2399.  
  2400.           Description   The ANSI  driver is  self modifying,  meaning  that
  2401.                         depending upon the color preference of the user, it
  2402.                         will adjusts its code accordingly. This function is
  2403.                         called by  init_ansi and  should never  need to  be
  2404.                         called  by   the  programmer  directly  unless  the
  2405.                         programmer provides  a menu choice whereby a caller
  2406.                         may toggle his/her color mode on and off. In such a
  2407.                         case, you  would immediately need to call fix_color
  2408.                         so that  the ANSI  driver can  adjusts itself.  The
  2409.                         caller's color preference is stored in the variable
  2410.                         color where 0 means no color, and 1 means color.
  2411.  
  2412.           Return Value  None.
  2413.  
  2414.           Example
  2415.  
  2416.              show_mess("Toggle Color",NO,NO);     // part of menu
  2417.  
  2418.              empty(response,1);           // clear string
  2419.              get_string(response);        // get response to menu
  2420.  
  2421.              if (response[0] == 'C')      // wants to toggle color
  2422.                {
  2423.                if (color)
  2424.                  color = 0
  2425.                else
  2426.                  color = 1;
  2427.  
  2428.                fix_color();               // fix up ANSI driver
  2429.                }
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.                                        Page 43
  2443.  
  2444.  
  2445.  
  2446.           GAP Communications                                         GAPCDR
  2447.  
  2448.  
  2449.           gapputc
  2450.           -----------------------------------------------------------------
  2451.  
  2452.           Purpose       Sends a single character to local and remote.
  2453.  
  2454.                         void gapputc(short ch);
  2455.  
  2456.                         ch         Character to send
  2457.  
  2458.           Type          Low Level
  2459.  
  2460.           Description   This is  one of  the main  output routines  that is
  2461.                         used internally  by GAPCDR.  It is part of the ANSI
  2462.                         driver. It  will send  a single  character  to  the
  2463.                         local screen  and if  a remote  caller is  on, will
  2464.                         send the  character to  the communications  port as
  2465.                         well.
  2466.  
  2467.           Return Value  None.
  2468.  
  2469.           Example       gapputc('A');        // display a character
  2470.  
  2471.              while ( (c = getakey()) == 0)   // wait for keypress
  2472.                dv_pause();                   // give up time slice
  2473.  
  2474.              gapputc(c);                     // display character
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.                                        Page 44
  2501.  
  2502.  
  2503.  
  2504.           GAP Communications                                         GAPCDR
  2505.  
  2506.  
  2507.           gapputs
  2508.           -----------------------------------------------------------------
  2509.  
  2510.           Purpose       Sends a string of characters to local and remote.
  2511.  
  2512.                         void gapputs(char *str);
  2513.  
  2514.                         str        String to send
  2515.  
  2516.           Type          Low Level
  2517.  
  2518.           Description   This is  one of  the main  output routines  that is
  2519.                         used internally  by GAPCDR.  It is part of the ANSI
  2520.                         driver. It  will send a string of characters to the
  2521.                         local screen  and if  a remote  caller is  on, will
  2522.                         send the string to the communications port as well.
  2523.                         If a  caller is  in mono mode, the ANSI driver will
  2524.                         strip any  ANSI sequences  from  the  string.  This
  2525.                         allows you  to "colorize"  your strings  with  ANSI
  2526.                         codes and  not have  to worry if the caller has his
  2527.                         color setting turned on.
  2528.  
  2529.                         This routine  is much  faster  than  show_mess  (in
  2530.                         fact, this  is the  function that show_mess calls),
  2531.                         but it  does not  provide for  ringing the  bell or
  2532.                         automatically sending  a carriage  return and  line
  2533.                         feed after  the string. You can however embed these
  2534.                         characters into  the string.  It is  suggested that
  2535.                         you not  embed the  bell character  into the string
  2536.                         since the  sysop may have the alarm toggled off and
  2537.                         may not  appreciate the  computer making noise when
  2538.                         he/she doesn't want it to.
  2539.  
  2540.           Return Value  None.
  2541.  
  2542.           Example       gapputs("This is a string of characters");
  2543.  
  2544.              // this example embeds the CR/LF pair at the beginning
  2545.              // and end of the string
  2546.  
  2547.              gapputs("\r\nThis is a string\r\n");
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.                                        Page 45
  2559.  
  2560.  
  2561.  
  2562.           GAP Communications                                         GAPCDR
  2563.  
  2564.  
  2565.           getakey
  2566.           -----------------------------------------------------------------
  2567.  
  2568.           Purpose       Gets one key responses
  2569.  
  2570.                         short getakey(void);
  2571.  
  2572.           Type          High Level
  2573.  
  2574.           Description   This is  the main  keyboard input  routine.  It  is
  2575.                         called  by  get_string  as  well  as  any  keyboard
  2576.                         polling loops. It checks the receive buffer as well
  2577.                         as the  local keyboard  for a  key press. If one is
  2578.                         not found  it returns 0. The character input is not
  2579.                         echoed. Since  99% of all keyboard input comes from
  2580.                         this  routine,   it  checks   for  time  remaining,
  2581.                         keyboard  time-out,   as  well   as  special  sysop
  2582.                         function keys.  The timeleft variable is updated by
  2583.                         this  routine.  This  is  the  variable  you  would
  2584.                         normally use in a prompt such as:
  2585.  
  2586.                                    [20 mins left] Main Command :
  2587.  
  2588.           Return Value  ASCII code for the key pressed or 0.
  2589.  
  2590.           Example       c = getakey();    // get a character
  2591.  
  2592.  
  2593.  
  2594.  
  2595.  
  2596.  
  2597.  
  2598.  
  2599.  
  2600.  
  2601.  
  2602.  
  2603.  
  2604.  
  2605.  
  2606.  
  2607.  
  2608.  
  2609.  
  2610.  
  2611.  
  2612.  
  2613.  
  2614.  
  2615.  
  2616.                                        Page 46
  2617.  
  2618.  
  2619.  
  2620.           GAP Communications                                         GAPCDR
  2621.  
  2622.  
  2623.           getkeyc
  2624.           -----------------------------------------------------------------
  2625.  
  2626.           Purpose       Gets keyboard character and scan code.
  2627.  
  2628.                         short getkeyc(void);
  2629.  
  2630.           Type          Low Level
  2631.  
  2632.           Description   This is  the main  keyboard input  routine which is
  2633.                         called  internally   by  getakey.  It  returns  the
  2634.                         keyboard character  or if  the key  struck  was  an
  2635.                         extended key,  it will  return a unique code. These
  2636.                         codes are  defined in  GAPSTRUC.H as F1, Home, etc.
  2637.                         This function  always waits  for a  keypress so  it
  2638.                         should not be called unless you know there is a key
  2639.                         waiting.
  2640.  
  2641.           Return Value  ASCII code for the key pressed or a unique code for
  2642.                         extended keys.
  2643.  
  2644.           Example       keyc = getkeyc(); // get a keyboard character
  2645.  
  2646.  
  2647.  
  2648.           get_attr
  2649.           -----------------------------------------------------------------
  2650.  
  2651.           Purpose       Retrieves the current screen color.
  2652.  
  2653.                         void get_attr(void);
  2654.  
  2655.           Type          Low Level
  2656.  
  2657.           Description   This function  is used  at  the  very  start  of  a
  2658.                         program to  "remember" the  screen color. It stores
  2659.                         the color  in a special location so that the screen
  2660.                         attributes  can  be  restored  by  the  DOS  Window
  2661.                         routines. You  do not  need to call this routine if
  2662.                         you have no plans to use the DOS Window.
  2663.  
  2664.           Return Value  None. Attribute is stored in an internal location.
  2665.  
  2666.           Example       get_attr();       // Remember screen attributes
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.                                        Page 47
  2675.  
  2676.  
  2677.  
  2678.           GAP Communications                                         GAPCDR
  2679.  
  2680.  
  2681.           get_random
  2682.           -----------------------------------------------------------------
  2683.  
  2684.           Purpose       Gets a random number.
  2685.  
  2686.                         short get_random(short low,short high);
  2687.  
  2688.                         low        Lowest number acceptible
  2689.                         high       Highest number acceptible
  2690.  
  2691.           Type          High Level
  2692.  
  2693.           Description   This routine  is provided because it is much easier
  2694.                         to use  and understand  than the  C library routine
  2695.                         (which  drags   in  the  floating  point  library).
  2696.                         Provide as  parameters,  two  integers.  The  first
  2697.                         parameter is the lowest number you will accept as a
  2698.                         random number,  and the  second  parameter  is  the
  2699.                         highest random number you will accept. The function
  2700.                         will return  a random  integer  between  the  range
  2701.                         specified (low  and high  are included in the range
  2702.                         of numbers). It is not necessary to seed the random
  2703.                         number generator  as this is done automatically for
  2704.                         you during program initialization.
  2705.  
  2706.           Return Value  A random number between range specified.
  2707.  
  2708.           Example       rndnum = get_random(1,10);     // get a random num
  2709.  
  2710.  
  2711.  
  2712.  
  2713.  
  2714.  
  2715.  
  2716.  
  2717.  
  2718.  
  2719.  
  2720.  
  2721.  
  2722.  
  2723.  
  2724.  
  2725.  
  2726.  
  2727.  
  2728.  
  2729.  
  2730.  
  2731.  
  2732.                                        Page 48
  2733.  
  2734.  
  2735.  
  2736.           GAP Communications                                         GAPCDR
  2737.  
  2738.  
  2739.           get_string
  2740.           -----------------------------------------------------------------
  2741.  
  2742.           Purpose       Gets a string of characters.
  2743.  
  2744.                         void get_string(char *string);
  2745.  
  2746.                         string     Storage for input characters
  2747.  
  2748.           Type          High Level
  2749.  
  2750.           Description   This is  the main  input routine.  It  will  get  a
  2751.                         string from  either the  remote user  or the  local
  2752.                         keyboard. The  string passed  will be  set  to  the
  2753.                         characters received. The length of the input string
  2754.                         is determined by the length of the string passed.
  2755.  
  2756.                         Before calling,  you  must  initialize  the  passed
  2757.                         string with  spaces. The  number of  spaces in  the
  2758.                         string determines  the number of characters allowed
  2759.                         to be  input. If  a  user  attempts  to  type  more
  2760.                         characters than  allowed, the  cursor will not move
  2761.                         pass the  end of  the string.  Input ends  when the
  2762.                         Enter key is pressed.
  2763.  
  2764.                         To initialize the string, use the empty function.
  2765.  
  2766.                         WARNING : It is extremely important that the passed
  2767.                         string be initialized. Failure to set the string to
  2768.                         spaces, will cause unpredictable results!
  2769.  
  2770.                         This function  does not  return a  new string  con-
  2771.                         taining the  keyboard input.  Instead, it  modifies
  2772.                         the string  you pass  to it  in the parameter list.
  2773.                         The string will be stripped of any trailing spaces.
  2774.  
  2775.                         Get_string automatically  uppercases the string. If
  2776.                         you wish  to disable this feature, set the variable
  2777.                         noup to  1 just  prior to calling the function, and
  2778.                         then set it back to 0 when the function returns.
  2779.  
  2780.                         Get_string will  automatically check  for  keyboard
  2781.                         activity so it is not necessary for you to do so.
  2782.  
  2783.           Return Value  None
  2784.  
  2785.           Example       get_string(instr);   // get a string
  2786.  
  2787.  
  2788.  
  2789.  
  2790.                                        Page 49
  2791.  
  2792.  
  2793.  
  2794.           GAP Communications                                         GAPCDR
  2795.  
  2796.  
  2797.              char instr [20];
  2798.  
  2799.              // First initialize the string. In this case we will
  2800.              // accept up to 10 characters
  2801.  
  2802.              empty(instr,10);             // initialize string
  2803.              get_string(instr);           // get string
  2804.  
  2805.  
  2806.           init_ansi
  2807.           -----------------------------------------------------------------
  2808.  
  2809.           Purpose       Initialize ANSI driver.
  2810.  
  2811.                         void init_ansi(void);
  2812.  
  2813.           Type          Low Level
  2814.  
  2815.           Description   This routine  is called  by init_door  so it is not
  2816.                         necessary for  you to call it again. It sets up the
  2817.                         ANSI driver  so that  it knows  the sysop's default
  2818.                         color, the current cursor position, etc.
  2819.  
  2820.           Return Value  None.
  2821.  
  2822.           Example       init_ansi();      // Initialize ANSI driver
  2823.  
  2824.  
  2825.  
  2826.           init_com
  2827.           -----------------------------------------------------------------
  2828.  
  2829.           Purpose       To configure the communications port.
  2830.  
  2831.                         void init_com(void);
  2832.  
  2833.           Type          High Level
  2834.  
  2835.           Description   This function  takes the  information  provided  by
  2836.                         DOOR.SYS and  makes a call to setport to set up the
  2837.                         communications  port  and  receive  buffer.  It  is
  2838.                         called internally  by init_door.  If  there  is  an
  2839.                         error setting  up the  port, init_com will exit the
  2840.                         program.
  2841.  
  2842.           Return Value  None. Exits on Error.
  2843.  
  2844.           Example       init_com();       // Initialize com port
  2845.  
  2846.  
  2847.  
  2848.                                        Page 50
  2849.  
  2850.  
  2851.  
  2852.           GAP Communications                                         GAPCDR
  2853.  
  2854.  
  2855.           init_door
  2856.           -----------------------------------------------------------------
  2857.  
  2858.           Purpose       Initializes the GAPCDR functions.
  2859.  
  2860.                         void init_door(void);
  2861.  
  2862.           Type          High Level
  2863.  
  2864.           Description   This  routine  must  be  called  immediately  after
  2865.                         calling read_cnf.  It initializes  the door,  opens
  2866.                         and reads  system files,  initializes the com port,
  2867.                         initializes global  variables and in general, makes
  2868.                         sure that  all of  the files required for operation
  2869.                         are present.  If an  error occurs  while trying  to
  2870.                         initialize, the  function  will  display  an  error
  2871.                         message and end the program.
  2872.  
  2873.           Return Value  None. Exits on error.
  2874.  
  2875.           Example
  2876.  
  2877.              fp = read_cnf("DOOR.CNF");   // read cnf file
  2878.              init_door();                 // init the door
  2879.              fclose(fp);                  // close configuration file
  2880.  
  2881.  
  2882.           init_port
  2883.           -----------------------------------------------------------------
  2884.  
  2885.           Purpose       Initialize port to baud, data, and parity.
  2886.  
  2887.                         init_port(short parity, short data);
  2888.  
  2889.                         parity     0 = None, 1 = Even
  2890.                         data       6,7,or 8 data bits
  2891.  
  2892.           Type          Low Level
  2893.  
  2894.           Description   Sets the communications port to the parity and data
  2895.                         bits  passed   as  parameters.  The  baud  rate  is
  2896.                         contained in  a global  variabled called  baud. The
  2897.                         port  number   (where  COM  1  equals  port  0)  is
  2898.                         contained in a global variabled called port.
  2899.  
  2900.           RETURN VALUE  0 = SUCCESSFUL, 1 = ERROR.
  2901.  
  2902.           Example       init_port(0,8)    // Initialize to N,8,1
  2903.  
  2904.  
  2905.  
  2906.                                        Page 51
  2907.  
  2908.  
  2909.  
  2910.           GAP Communications                                         GAPCDR
  2911.  
  2912.  
  2913.           iscd
  2914.           -----------------------------------------------------------------
  2915.  
  2916.           Purpose       Check for Carrier on the Communications Port.
  2917.  
  2918.                         short iscd(void);
  2919.  
  2920.           Type          Low Level
  2921.  
  2922.           Description   This function allows you to test the communications
  2923.                         port for a remote carrier signal. Note that carrier
  2924.                         checking  is   performed   automatically   by   the
  2925.                         communications routines  so it is not necessary for
  2926.                         you to explicitly check for carrier unless you have
  2927.                         a need to override the default actions taken.
  2928.  
  2929.           Return Value  Returns 0  if there is no carrier and 1 if there is
  2930.                         a carrier.
  2931.  
  2932.           Example
  2933.  
  2934.              if ( !iscd())                // is there a carrier?
  2935.                leave(99);                 // nope, lets quit
  2936.  
  2937.  
  2938.           leave
  2939.           -----------------------------------------------------------------
  2940.  
  2941.           Purpose       Exits the program.
  2942.  
  2943.                         void leave(short code);
  2944.  
  2945.                         code       Exit code to terminate with
  2946.  
  2947.           Type          High Level
  2948.  
  2949.           Description   When the  program terminates,  it  must  call  this
  2950.                         function to  end. This is the only proper exit from
  2951.                         the door.  It is  of vital  importance to  end your
  2952.                         program through this function so that the interrupt
  2953.                         service  routines   that  are   installed  at  door
  2954.                         beginning can be removed.
  2955.  
  2956.           Return Value  None.
  2957.  
  2958.           Example       leave(0);       // Exit the program
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.                                        Page 52
  2965.  
  2966.  
  2967.  
  2968.           GAP Communications                                         GAPCDR
  2969.  
  2970.  
  2971.           lputc, lputs
  2972.           -----------------------------------------------------------------
  2973.  
  2974.           Purpose       To display  a character  or string of characters on
  2975.                         the local screen.
  2976.  
  2977.                         void lputc(char ch);
  2978.  
  2979.                         ch         Character to display
  2980.  
  2981.                         void lputs(char *str);
  2982.  
  2983.                         str        String to display
  2984.  
  2985.           Type          Low Level
  2986.  
  2987.           Description   Like gapputc  and gapputs,  these functions display
  2988.                         either  a   single  character   or  a   string   of
  2989.                         characters,  however   the   characters   are   not
  2990.                         simultaneously sent  to the  communications port as
  2991.                         well. These  functions override  the color  mode of
  2992.                         the caller  and allow you to send ANSI color to the
  2993.                         local screen  even if  the caller does not have his
  2994.                         color flag turned on.
  2995.  
  2996.           Return Value  None.
  2997.  
  2998.           Example       lputs("This is a string");     // Send string
  2999.  
  3000.  
  3001.  
  3002.           more
  3003.           -----------------------------------------------------------------
  3004.  
  3005.           Purpose       Checks for a full screen and issues a More Prompt.
  3006.  
  3007.                         void more(void);
  3008.  
  3009.           Type          High Level
  3010.  
  3011.           Description   This is  an internal  routine that is called by the
  3012.                         character output functions. It issues a more prompt
  3013.                         if the number of lines displayed reaches the user's
  3014.                         page length.
  3015.  
  3016.           Return Value  None.
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.                                        Page 53
  3023.  
  3024.  
  3025.  
  3026.           GAP Communications                                         GAPCDR
  3027.  
  3028.  
  3029.           nl
  3030.           -----------------------------------------------------------------
  3031.  
  3032.           Purpose       Sends a  Carriage Return and Line Feed to local and
  3033.                         remote.
  3034.  
  3035.                         void nl(short lines);
  3036.  
  3037.                         lines      Number of New Lines to send
  3038.  
  3039.           Type          High Level
  3040.  
  3041.           Description   To send  a blank  line, call  this routine with the
  3042.                         number of blank lines you wish to send.
  3043.  
  3044.           Return Value  None
  3045.  
  3046.           Example       nl(2);          // send two blank lines
  3047.  
  3048.  
  3049.  
  3050.           no_carrier
  3051.           -----------------------------------------------------------------
  3052.  
  3053.           Purpose       Used by the Communications routines.
  3054.  
  3055.                         void no_carrier(void);
  3056.  
  3057.           Type          High Level
  3058.  
  3059.           Description   Internal routine  that is  called when  there is  a
  3060.                         loss of  carrier. Displays  a message  to the local
  3061.                         screen  and  then  calls  leave  to  terminate  the
  3062.                         program. This  function must  not be  removed  from
  3063.                         GAPCDR. You  may modify  it to  change the  default
  3064.                         actions that  are  taken,  but  the  communications
  3065.                         routines must  have access to it if there is a loss
  3066.                         of carrier.
  3067.  
  3068.           Return Value  None.
  3069.  
  3070.           Example
  3071.  
  3072.  
  3073.  
  3074.  
  3075.  
  3076.  
  3077.  
  3078.  
  3079.  
  3080.                                        Page 54
  3081.  
  3082.  
  3083.  
  3084.           GAP Communications                                         GAPCDR
  3085.  
  3086.  
  3087.           pagesysop
  3088.           -----------------------------------------------------------------
  3089.  
  3090.           Purpose       Alerts sysop that user wants to chat.
  3091.  
  3092.                         void pagesysop(void);
  3093.  
  3094.           Type          High Level
  3095.  
  3096.           Description   Allows the  programer to  provide the  user with  a
  3097.                         Page Sysop  command. The  page lasts for 30 seconds
  3098.                         and can be aborted by typing CTRL-K. If the sysop's
  3099.                         page bell  is on,  the sysop's  speaker  will  also
  3100.                         sound. To  answer the  page, the sysop should press
  3101.                         CTRL-F10.
  3102.  
  3103.           Return Value  None.
  3104.  
  3105.           Example       pagesysop();      // tell sysop
  3106.  
  3107.              empty(response,1);           // initialize string
  3108.  
  3109.              get_string(response);        // get a response
  3110.  
  3111.              if (response[0] == 'P')      // wants to chat
  3112.                pagesysop();               // tell sysop
  3113.  
  3114.  
  3115.           pause
  3116.           -----------------------------------------------------------------
  3117.  
  3118.           Purpose       Sends a "Press [Any Key] To Continue" prompt.
  3119.  
  3120.                         void pause(void);
  3121.  
  3122.           Type          High Level
  3123.  
  3124.           Description   This function  sends a pause prompt and waits for a
  3125.                         key press.
  3126.  
  3127.           Return Value  None.
  3128.  
  3129.           Example       pause();        // display pause prompt
  3130.  
  3131.  
  3132.  
  3133.  
  3134.  
  3135.  
  3136.  
  3137.  
  3138.                                        Page 55
  3139.  
  3140.  
  3141.  
  3142.           GAP Communications                                         GAPCDR
  3143.  
  3144.  
  3145.           putkey
  3146.           -----------------------------------------------------------------
  3147.  
  3148.           Purpose       Used  by  chat  routines  to  keep  track  of  word
  3149.                         wrapping.
  3150.  
  3151.                         void putkey(short ch);
  3152.  
  3153.                         ch         Character to send
  3154.  
  3155.           Type          High Level
  3156.  
  3157.           Description   This is  the  main  output  routine  for  the  chat
  3158.                         functions. It  keeps track  of the  current column,
  3159.                         and decides when it is time to wrap a word.
  3160.  
  3161.           Return Value  None.
  3162.  
  3163.           Example
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.  
  3176.  
  3177.  
  3178.  
  3179.  
  3180.  
  3181.  
  3182.  
  3183.  
  3184.  
  3185.  
  3186.  
  3187.  
  3188.  
  3189.  
  3190.  
  3191.  
  3192.  
  3193.  
  3194.  
  3195.  
  3196.                                        Page 56
  3197.  
  3198.  
  3199.  
  3200.           GAP Communications                                         GAPCDR
  3201.  
  3202.  
  3203.           read_cnf
  3204.           -----------------------------------------------------------------
  3205.  
  3206.           Purpose       Reads the door configuration file.
  3207.  
  3208.                         FILE *read_cnf(char *path);
  3209.  
  3210.                         path       Full path and name of configuration file
  3211.  
  3212.           Type          High Level
  3213.  
  3214.           Description   Opens the  configuration file for the current door.
  3215.                         Normally the  passed parameter  is the  name of the
  3216.                         door with  a .CNF extension (it is assumed that the
  3217.                         file is in the same directory as the door program).
  3218.                         If an error occurs, the program ends immediately.
  3219.  
  3220.                         WARNING :  The first eight lines of this configura-
  3221.                         tion file  belong to  the GAPCDR  interface module.
  3222.                         You are  free to  use the  information, but the in-
  3223.                         formation contained  in the  first eight lines must
  3224.                         conform exactly to the following specifications.
  3225.  
  3226.                         The first  line of  this file is the full drive and
  3227.                         path to  the BBS  default directory.  This  is  the
  3228.                         directory where  the BBS created the DOOR.SYS file.
  3229.                         The second  line is  the name of the BBS. The third
  3230.                         line is  the IRQ  for the port, and the fourth line
  3231.                         is the Base Address for the port. If the sysop uses
  3232.                         Com Ports other than 1 or 2, then he must enter the
  3233.                         appropriate IRQ and BASE address so that GAPCDR can
  3234.                         properly open  the port.  If Com  ports 1  or 2 are
  3235.                         used, then  a 0  may be  entered on  both of  these
  3236.                         lines. The  fifth line  is the  Communications Port
  3237.                         Interface and  must be  either STANDARD, DIGIBOARD,
  3238.                         or INT14/EBIOS.  The sixth  line is  the  DigiBoard
  3239.                         Memory Window.  The seventh  line is  the DigiBoard
  3240.                         I/O Port  Address. The eighth line is the DigiBoard
  3241.                         Channel Number.
  3242.  
  3243.                         It is  the responsibility  of the  door  author  to
  3244.                         describe the format of these eight lines to the end
  3245.                         user.   If    your   door   program   requires   no
  3246.                         configuration parameters of its own, you can simply
  3247.                         distribute a  sample configuration  file with these
  3248.                         eight lines already in it.
  3249.  
  3250.  
  3251.  
  3252.  
  3253.  
  3254.                                        Page 57
  3255.  
  3256.  
  3257.  
  3258.           GAP Communications                                         GAPCDR
  3259.  
  3260.  
  3261.                         GAPCDR will  not close  this file after reading the
  3262.                         first four  lines. It  leaves the file open for the
  3263.                         programmer's use.  Remember that  you assign a FILE
  3264.                         pointer to  the return value so that you may access
  3265.                         the  file.   If  your  door  does  require  certain
  3266.                         configuration parameters, have your users place the
  3267.                         parameters in the file starting with line 9. If you
  3268.                         use a  set up  program, be  sure that  your set  up
  3269.                         program writes the first eight lines as specified.
  3270.  
  3271.                         After you  have called  read_cnf and  init_door, if
  3272.                         you  have   any  configuration   options   in   the
  3273.                         configuration file, you should use the stream input
  3274.                         routines to  read those  options. Then  fclose  the
  3275.                         file using  the FILE  pointer returned. Even if you
  3276.                         have no options to read, you must close the file.
  3277.  
  3278.                         WARNING :  You must  call this routine before using
  3279.                         any of  the GAPCDR  functions. After  calling  this
  3280.                         routine, you must call init_door.
  3281.  
  3282.           Return Value  FILE pointer.
  3283.  
  3284.           Example
  3285.  
  3286.              FILE *fp;                       // File pointer
  3287.  
  3288.              fp = read_cnf("TOURIST.CNF");   // read cnf file
  3289.              fclose(fp);                     // close the file
  3290.              init_door();                    // init the door
  3291.  
  3292.  
  3293.           read_doorsys
  3294.           -----------------------------------------------------------------
  3295.  
  3296.           Purpose       Reads the DOOR.SYS universal door interface file.
  3297.  
  3298.                         short read_doorsys(void);
  3299.  
  3300.           Type          High Level
  3301.  
  3302.           Description   Internal routine  called by  init_door.  Reads  the
  3303.                         DOOR.SYS file  and initializes any global variables
  3304.                         that depend on the information in that file.
  3305.  
  3306.           Return Value  0 = no error, 1 = error.
  3307.  
  3308.           Example       c = read_doorsys();
  3309.  
  3310.  
  3311.  
  3312.                                        Page 58
  3313.  
  3314.  
  3315.  
  3316.           GAP Communications                                         GAPCDR
  3317.  
  3318.  
  3319.           read_gapuser
  3320.           -----------------------------------------------------------------
  3321.  
  3322.           Purpose       Reads the GAP Communications USERS.DAT file.
  3323.  
  3324.                         short read_gapuser(char *path);
  3325.  
  3326.                         path       Full path and name of the USERS file
  3327.  
  3328.           Type          High Level
  3329.  
  3330.           Description   Reads the  user record  of the  current user in the
  3331.                         GAP USERS.DAT  file. The  record  is  read  into  a
  3332.                         structure variable  called gapuser. You must supply
  3333.                         the path  and name  to the  base part  of the  User
  3334.                         file. GAP  stores the  name of the User file in the
  3335.                         GAPBBS.CNF file  (which you  must  read  yourself).
  3336.                         Read_gapuser will add the .DAT extension.
  3337.  
  3338.           Return Value  0 = no error, 1 = error.
  3339.  
  3340.           Example       c = read_gapuser(userpath);
  3341.  
  3342.  
  3343.  
  3344.           read_pcbsys
  3345.           -----------------------------------------------------------------
  3346.  
  3347.           Purpose       Reads the PCBOARD.SYS file.
  3348.  
  3349.                         short read_pcbsys(void);
  3350.  
  3351.           Type          High Level
  3352.  
  3353.           Description   Reads the  PCBOARD.SYS system  file. The  record is
  3354.                         read into a structure variable called pcbsys.
  3355.  
  3356.           Return Value  0 = no error, 1 = error.
  3357.  
  3358.           Example       c = read_pcbsys();
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370.                                        Page 59
  3371.  
  3372.  
  3373.  
  3374.           GAP Communications                                         GAPCDR
  3375.  
  3376.  
  3377.           read_pcbuser
  3378.           -----------------------------------------------------------------
  3379.  
  3380.           Purpose       Reads the PCB USERS file.
  3381.  
  3382.                         short read_pcbuser(char *path);
  3383.  
  3384.                         path       Full path and name of the USERS file
  3385.  
  3386.           Type          High Level
  3387.  
  3388.           Description   Reads the  user record  of the  current user in the
  3389.                         PCB USERS file. The record is read into a structure
  3390.                         variable called  pcbuser. You  must supply the path
  3391.                         and name to the User file. PCB stores the path\name
  3392.                         of the User file in the PCBOARD.DAT file (which you
  3393.                         must read yourself).
  3394.  
  3395.           Return Value  0 = no error, 1 = error.
  3396.  
  3397.           Example       c = read_pcbuser(userpath);
  3398.  
  3399.  
  3400.  
  3401.  
  3402.  
  3403.  
  3404.  
  3405.  
  3406.  
  3407.  
  3408.  
  3409.  
  3410.  
  3411.  
  3412.  
  3413.  
  3414.  
  3415.  
  3416.  
  3417.  
  3418.  
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427.  
  3428.                                        Page 60
  3429.  
  3430.  
  3431.  
  3432.           GAP Communications                                         GAPCDR
  3433.  
  3434.  
  3435.           read_score
  3436.           -----------------------------------------------------------------
  3437.  
  3438.           Purpose       Reads the score file and displays the results.
  3439.  
  3440.                         short read_score(char *datfile,char *message);
  3441.  
  3442.                         datfile    Path and name of data file to read
  3443.                         message    Message to display
  3444.  
  3445.           Type          High Level
  3446.  
  3447.           Description   This function  will read  the scoreboard  data file
  3448.                         for your door (if any) and display the results. You
  3449.                         pass as  parameters the  name of  the data  file to
  3450.                         read, and  a message  to display  at the top of the
  3451.                         scoreboard. The  message could  be  something  like
  3452.                         "Top 10 Players".
  3453.  
  3454.           Return Value  0 = scores read, 1 = no scores to read.
  3455.  
  3456.           Example       read_score("TOURIST.DAT","Top 10 Tourists");
  3457.  
  3458.              if (read_score("TOURIST.DAT","Top 10 Tourists"))
  3459.                {
  3460.                nl(1);
  3461.                ansi(BWHITE);
  3462.                show_mess("No one's made it Yet!",NO,YES);
  3463.                }
  3464.  
  3465.  
  3466.  
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472.  
  3473.  
  3474.  
  3475.  
  3476.  
  3477.  
  3478.  
  3479.  
  3480.  
  3481.  
  3482.  
  3483.  
  3484.  
  3485.  
  3486.                                        Page 61
  3487.  
  3488.  
  3489.  
  3490.           GAP Communications                                         GAPCDR
  3491.  
  3492.  
  3493.           reset_port
  3494.           -----------------------------------------------------------------
  3495.  
  3496.           Purpose       Restores the Communications port.
  3497.  
  3498.                         void reset_port(void);
  3499.  
  3500.           Type          Low Level
  3501.  
  3502.           Description   This function  must be  called prior to exiting the
  3503.                         program. It  restores the  interrupt vector used by
  3504.                         the   communications   routines.   It   is   called
  3505.                         internally by  leave so it is not necessary for you
  3506.                         to explicitly invoke it.
  3507.  
  3508.           Return Value  None.
  3509.  
  3510.           Example       reset_port();     // Restore communications port
  3511.  
  3512.  
  3513.  
  3514.  
  3515.  
  3516.  
  3517.  
  3518.  
  3519.  
  3520.  
  3521.  
  3522.  
  3523.  
  3524.  
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533.  
  3534.  
  3535.  
  3536.  
  3537.  
  3538.  
  3539.  
  3540.  
  3541.  
  3542.  
  3543.  
  3544.                                        Page 62
  3545.  
  3546.  
  3547.  
  3548.           GAP Communications                                         GAPCDR
  3549.  
  3550.  
  3551.           restore_screen
  3552.           -----------------------------------------------------------------
  3553.  
  3554.           Purpose       Restores a previously saved portion of the screen.
  3555.  
  3556.                         void restore_screen(short topr, short topc,
  3557.                                             short botr, short botc,
  3558.                                             unsigned short memseg);
  3559.  
  3560.                         topr       Top row of screen
  3561.                         topc       Top left column of screen
  3562.                         botr       Bottom row of screen
  3563.                         botc       Bottom right column of screen
  3564.                         memseg     Segment of buffer to save to
  3565.  
  3566.           Type          Low Level
  3567.  
  3568.           Description   This function  allows you  to restore  a previously
  3569.                         saved portion of the screen. You supply the top row
  3570.                         and column  and  the  bottom  row  and  column  co-
  3571.                         ordinates of  the rectangle. All co-ordinates are 0
  3572.                         based. The  memseg is  the segment  address of  the
  3573.                         buffer that  a previous  call to  save_screen saved
  3574.                         the video contents to.
  3575.  
  3576.           Return Value  None.
  3577.  
  3578.           Example       restore_screen(3,8,16,71,dseg);
  3579.  
  3580.  
  3581.  
  3582.  
  3583.  
  3584.  
  3585.  
  3586.  
  3587.  
  3588.  
  3589.  
  3590.  
  3591.  
  3592.  
  3593.  
  3594.  
  3595.  
  3596.  
  3597.  
  3598.  
  3599.  
  3600.  
  3601.  
  3602.                                        Page 63
  3603.  
  3604.  
  3605.  
  3606.           GAP Communications                                         GAPCDR
  3607.  
  3608.  
  3609.           rest_cbreak
  3610.           -----------------------------------------------------------------
  3611.  
  3612.           Purpose       Restores the Ctrl-Break vector.
  3613.  
  3614.                         void rest_cbreak(void);
  3615.  
  3616.           Type          Low Level
  3617.  
  3618.           Description   This function  must be  called prior to exiting the
  3619.                         program. It  restores the  interrupt vector used by
  3620.                         the Ctrl-Break  routine. It is called internally by
  3621.                         leave so  it is not necessary for you to explicitly
  3622.                         invoke it.
  3623.  
  3624.           Return Value  None.
  3625.  
  3626.           Example       rest_cbreak();    // restore Ctrl-Break vector
  3627.  
  3628.  
  3629.  
  3630.           rest_int10
  3631.           -----------------------------------------------------------------
  3632.  
  3633.           Purpose       Restores the interrupt 10 (BIOS) vector.
  3634.  
  3635.                         void rest_int10(void);
  3636.  
  3637.           Type          Low Level
  3638.  
  3639.           Description   When setting  up  an  interrupt  10  BIOS  trap  to
  3640.                         protect a  DOS Window, this function must be called
  3641.                         when it is no longer necessary to protect a portion
  3642.                         of the screen.
  3643.  
  3644.           Return Value  None.
  3645.  
  3646.           Example       See the example for set_cord.
  3647.  
  3648.  
  3649.  
  3650.  
  3651.  
  3652.  
  3653.  
  3654.  
  3655.  
  3656.  
  3657.  
  3658.  
  3659.  
  3660.                                        Page 64
  3661.  
  3662.  
  3663.  
  3664.           GAP Communications                                         GAPCDR
  3665.  
  3666.  
  3667.           rts
  3668.           -----------------------------------------------------------------
  3669.  
  3670.           Purpose       Toggle the RTS line on and off.
  3671.  
  3672.                         void rts(short how)
  3673.  
  3674.                         how        0 = Turn RTS off.
  3675.                                    1 = Turn RTS on
  3676.  
  3677.           Type          Low Level
  3678.  
  3679.           Description   This routine  is used  to turn  the RTS line of the
  3680.                         communications port  on or  off.  Turning  RTS  off
  3681.                         (providing the modem supports hardware handshaking)
  3682.                         tells  the  modem  to  stop  sending  data  to  the
  3683.                         computer. It is typically toggled off while writing
  3684.                         a buffer of data to a disk.
  3685.  
  3686.           Return Value  None.
  3687.  
  3688.           Example       rts(0);         // Turn RTS off
  3689.  
  3690.  
  3691.  
  3692.           rxempty
  3693.           -----------------------------------------------------------------
  3694.  
  3695.           Purpose       To check if there are any characters in the receive
  3696.                         buffer.
  3697.  
  3698.                         short rxempty(void);
  3699.  
  3700.           Type          Low Level
  3701.  
  3702.           Description   This function  checks  the  communications  receive
  3703.                         buffer to  see if  there are any characters waiting
  3704.                         to be read.
  3705.  
  3706.           Return Value  Returns 1  if buffer  is  empty,  0  if  there  are
  3707.                         characters waiting to be read.
  3708.  
  3709.           Example
  3710.  
  3711.              while (rxempty())            // nothing happening
  3712.                dv_pause();                // give up time slice
  3713.  
  3714.  
  3715.  
  3716.  
  3717.  
  3718.                                        Page 65
  3719.  
  3720.  
  3721.  
  3722.           GAP Communications                                         GAPCDR
  3723.  
  3724.  
  3725.           save_screen
  3726.           -----------------------------------------------------------------
  3727.  
  3728.           Purpose       Saves a portion of the screen.
  3729.  
  3730.                         void save_screen(short topr, short topc,
  3731.                                          short botr, short botc,
  3732.                                          unsigned short memseg);
  3733.  
  3734.                         topr       Top row of screen
  3735.                         topc       Top left column of screen
  3736.                         botr       Bottom row of screen
  3737.                         botc       Bottom right column of screen
  3738.                         memseg     Segment of buffer to save to
  3739.  
  3740.           Type          Low Level
  3741.  
  3742.           Description   This function  allows you  to  save  a  rectangular
  3743.                         portion of  the screen.  You supply the top row and
  3744.                         column and  the bottom  row and column co-ordinates
  3745.                         of the rectangle. All co-ordinates are 0 based. The
  3746.                         memseg is  the segment  address of a buffer to save
  3747.                         the video  contents to  and assumes your buffer was
  3748.                         allocated by  DOS (i.e.,  the offset portion of the
  3749.                         buffer begins at 0).
  3750.  
  3751.           Return Value  None.
  3752.  
  3753.           Example
  3754.  
  3755.              unsigned short dseg;
  3756.  
  3757.              dos_allocatemem(114,&dseg);  // get some memory
  3758.              save_screen(3,8,16,71,dseg); // save contents of video
  3759.  
  3760.  
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766.  
  3767.  
  3768.  
  3769.  
  3770.  
  3771.  
  3772.  
  3773.  
  3774.  
  3775.  
  3776.                                        Page 66
  3777.  
  3778.  
  3779.  
  3780.           GAP Communications                                         GAPCDR
  3781.  
  3782.  
  3783.           setport
  3784.           -----------------------------------------------------------------
  3785.  
  3786.           Purpose       Initialize the Communications Port.
  3787.  
  3788.                         short set_port(short bufsize, short irq,
  3789.                                        short base);
  3790.  
  3791.                         bufsize    Size of Receive buffer
  3792.                         irq        Port IRQ to use
  3793.                         base       Port Base Address to use
  3794.  
  3795.           Type          Low Level
  3796.  
  3797.           Description   This is  the port  initialization routine  that  is
  3798.                         called by  init_com. Bufsize  is the  size  of  the
  3799.                         receive buffer  to set  up. Set_port  will allocate
  3800.                         memory based  upon this  size. Typical  values  are
  3801.                         from 1200  to 4096  bytes. Note  that  the  bufsize
  3802.                         argument  is   ignored  when   using  the   Borland
  3803.                         compiler. This  is because Borland does not provide
  3804.                         a memory  allocation routine  that allocates memory
  3805.                         in the  near heap  (irregardless of  memory model).
  3806.                         For Borland,  the bufsize  is fixed  at 2048 bytes.
  3807.                         IRQ is  the Interrupt Request number to use for the
  3808.                         port and Base Address is the address where the port
  3809.                         is located.  The Port  number is  a global variable
  3810.                         that is set when reading DOOR.SYS. Ports start with
  3811.                         0, where  0 equals  COM 1, 1 equals COM 2, etc. For
  3812.                         COM 1  and COM  2, you may simply pass 0 as the IRQ
  3813.                         and Base address since the defaults for these ports
  3814.                         will be used.
  3815.  
  3816.           Return Value  0 = successful, 1 = error encountered.
  3817.  
  3818.           Example
  3819.  
  3820.              // set up the port with a buffer size of 2k, using COM 1
  3821.  
  3822.              port = 0;
  3823.  
  3824.              if (setport(2048, 0, 0))
  3825.                exit(1);
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.                                        Page 67
  3835.  
  3836.  
  3837.  
  3838.           GAP Communications                                         GAPCDR
  3839.  
  3840.  
  3841.           set_attr
  3842.           -----------------------------------------------------------------
  3843.  
  3844.           Purpose       Sets the video color attributes.
  3845.  
  3846.                         void set_attr(unsigned  char  forg,  unsigned  char
  3847.                         back);
  3848.  
  3849.                         forg       Foreground Color (0-15)
  3850.                         back       Background Color (0-7)
  3851.  
  3852.           Type          Low Level
  3853.  
  3854.           Description   This function  is used just prior to invoking a DOS
  3855.                         Window so that the window colors can be set.
  3856.  
  3857.           Return Value  None.
  3858.  
  3859.           Example       See the example for set_cord.
  3860.  
  3861.  
  3862.  
  3863.           set_cbreak
  3864.           -----------------------------------------------------------------
  3865.  
  3866.           Purpose       Initializes the Ctrl-Break vector.
  3867.  
  3868.                         void set_cbreak(void);
  3869.  
  3870.           Type          Low Level
  3871.  
  3872.           Description   To trap Ctrl-C and Ctrl-Break, this function should
  3873.                         be called to set up an interrupt service routine to
  3874.                         trap these  two keys.  It is  imperitive  that  the
  3875.                         program not exit before calling rest_cbreak so that
  3876.                         the interrupt  vector can  be restored.  Leave does
  3877.                         this for you automatically.
  3878.  
  3879.           Return Value  None.
  3880.  
  3881.           Example       set_cbreak();     // set up Ctrl-Break ISR
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.  
  3892.                                        Page 68
  3893.  
  3894.  
  3895.  
  3896.           GAP Communications                                         GAPCDR
  3897.  
  3898.  
  3899.           set_cord
  3900.           -----------------------------------------------------------------
  3901.  
  3902.           Purpose       Set up a DOS Window.
  3903.  
  3904.                         void set_cord(unsigned char topr,
  3905.                                       unsigned char topc,
  3906.                                       unsigned char botr,
  3907.                                       unsigned char botc);
  3908.  
  3909.                         topr       Top left row
  3910.                         topc       Top left column
  3911.                         botr       Bottom row
  3912.                         botc       Bottom right column
  3913.  
  3914.           Type          Low Level
  3915.  
  3916.           Description   This function  sets the  window co-ordinates  for a
  3917.                         DOS Window. Using this function in combination with
  3918.                         set_int10 allows  you to set up a window into which
  3919.                         all local  screen output will be directed. Topr and
  3920.                         topc are the top left corner of the window and botr
  3921.                         and botc are the bottom right corner of the window.
  3922.                         All co-ordinates are 0 based.
  3923.  
  3924.           Return Value  None.
  3925.  
  3926.           Example
  3927.  
  3928.              _dos_allocmem(114,&dseg);       // get some memory
  3929.              save_screen(3,8,16,71,dseg);    // save a part of screen
  3930.              set_int10();                    // set up BIOS trap
  3931.              set_cord(4,9,15,70);            // tell it what to protect
  3932.              set_attr(14,1);                 // Yellow on Blue
  3933.              cls_all();                      // clear the window
  3934.              system("COMMAND");              // go to DOS
  3935.              rest_int10();                   // restore vector
  3936.              restore_screen(3,8,16,71,dseg); // restore screen
  3937.              _dos_freemem(dseg);             // free memory
  3938.  
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.                                        Page 69
  3951.  
  3952.  
  3953.  
  3954.           GAP Communications                                         GAPCDR
  3955.  
  3956.  
  3957.           set_int10
  3958.           -----------------------------------------------------------------
  3959.  
  3960.           Purpose       Set up an interrupt 10 (BIOS) trapper.
  3961.  
  3962.                         void set_int10(void);
  3963.  
  3964.           Type          Low Level
  3965.  
  3966.           Description   This function intercepts the Interrupt 10 vector so
  3967.                         that it  can trap  calls to  the BIOS  video output
  3968.                         routines. It  is used  in conjunction with set_cord
  3969.                         to set  up a  portion of  the screen into which all
  3970.                         video output  through the BIOS will be directed. If
  3971.                         a console driver other than CON or ANSI.SYS is used
  3972.                         that writes  directly to  the screen, this function
  3973.                         will not work.
  3974.  
  3975.           Return Value  None.
  3976.  
  3977.           Example       See the example for set_cord.
  3978.  
  3979.  
  3980.  
  3981.           set_status
  3982.           -----------------------------------------------------------------
  3983.  
  3984.           Purpose       Displays and updates the sysop status line.
  3985.  
  3986.                         void set_status(short how);
  3987.  
  3988.                         how        0 = set the status line
  3989.                                    1 = update the status line
  3990.                                    4 = show other user stats
  3991.  
  3992.  
  3993.           Type          High Level
  3994.  
  3995.           Description   Displays or updates the sysop status line.
  3996.  
  3997.           Return Value  None.
  3998.  
  3999.           Example       set_status(0);    // display status line
  4000.  
  4001.  
  4002.  
  4003.  
  4004.  
  4005.  
  4006.  
  4007.  
  4008.                                        Page 70
  4009.  
  4010.  
  4011.  
  4012.           GAP Communications                                         GAPCDR
  4013.  
  4014.  
  4015.           show_file
  4016.           -----------------------------------------------------------------
  4017.  
  4018.           Purpose       Displays a text file.
  4019.  
  4020.                         void show_file(char *filename);
  4021.  
  4022.                         filename   Full path and name of file to display
  4023.  
  4024.           Type          High Level
  4025.  
  4026.           Description   Many door  programs have  welcome, news, exit, help
  4027.                         and other  files to  show to  the user  at  various
  4028.                         points in  the program.  This is  the function that
  4029.                         allows you  to do  that. To  display a  file to the
  4030.                         user,   call    the   function    with   the   full
  4031.                         drive\path\filename of the file to display.
  4032.  
  4033.                         If you  have color  and non-color versions of files
  4034.                         pass the  name of  the non-color  version  as  this
  4035.                         function will  automatically append  a "G"  to  the
  4036.                         filename if  the user  is in  color mode.  In fact,
  4037.                         this function will always try to find a file with a
  4038.                         "G" appended to the end of the name (if the user is
  4039.                         in color  mode) before it looks for the actual file
  4040.                         by the  name you  specified. If you pass "WELCOMEG"
  4041.                         to this  function and the user is in color mode, it
  4042.                         will first  try to  find a  file with  the name  of
  4043.                         "WELCOMEGG".
  4044.  
  4045.                         Pressing CTRL-K  or  CTRL-X  will  abort  any  file
  4046.                         display.
  4047.  
  4048.                         REMEMBER :  If you  have both  color and  non-color
  4049.                         versions of  the same  files, pass  the name of the
  4050.                         non-color version. Also, the actual disk files must
  4051.                         be named  in such  a way  that they  have  no  file
  4052.                         extension and the color version ends with a "G".
  4053.  
  4054.           Return Value  None.
  4055.  
  4056.           Example       show_file("WELCOME");     // display welcome file
  4057.  
  4058.  
  4059.  
  4060.  
  4061.  
  4062.  
  4063.  
  4064.  
  4065.  
  4066.                                        Page 71
  4067.  
  4068.  
  4069.  
  4070.           GAP Communications                                         GAPCDR
  4071.  
  4072.  
  4073.           show_mess
  4074.           -----------------------------------------------------------------
  4075.  
  4076.           Purpose       Displays a message.
  4077.  
  4078.                         void show_mess(char *message,short bell,
  4079.                                        short newline);
  4080.  
  4081.                         message    Message to display.
  4082.                         bell       YES or NO to ring the bell.
  4083.                         newline    YES or NO to issue a CR/LF after
  4084.                                    message.
  4085.  
  4086.           Type          High Level
  4087.  
  4088.           Description   This is the main string output function for GAPCDR.
  4089.                         Under most circumstances, this is the only function
  4090.                         that you would call to display output to the user.
  4091.  
  4092.           Return Value  None
  4093.  
  4094.           Example       show_mess("This is a message!",NO,YES);
  4095.  
  4096.              // the first show_mess displays the string and leaves the
  4097.              // cursor on the same line. The second displays the
  4098.              // string, rings the remote user's bell, and drops the
  4099.              // cursor to the next line.
  4100.  
  4101.              nl(1);
  4102.              show_mess("Are you ready? (Y/N) : ",NO,NO);
  4103.  
  4104.              empty(response,3);
  4105.              get_string(response);
  4106.  
  4107.              if (response[0] == 'Y')
  4108.                // begin whatever it is you want to begin
  4109.              else
  4110.                show_mess("Too Bad!",YES,YES);
  4111.  
  4112.  
  4113.  
  4114.  
  4115.  
  4116.  
  4117.  
  4118.  
  4119.  
  4120.  
  4121.  
  4122.  
  4123.  
  4124.                                        Page 72
  4125.  
  4126.  
  4127.  
  4128.           GAP Communications                                         GAPCDR
  4129.  
  4130.  
  4131.           timer
  4132.           -----------------------------------------------------------------
  4133.  
  4134.           Purpose       Pauses for the number of "ticks" specified.
  4135.  
  4136.                         void timer(short ticks);
  4137.  
  4138.                         ticks      Number of timer ticks to pause.
  4139.  
  4140.           Type          High Level
  4141.  
  4142.           Description   This function  allows you  to pause  all processing
  4143.                         for the  specified  number  of  ticks.  It  is  in-
  4144.                         sensitive to processor speed.
  4145.  
  4146.                         The function  simply delays  the number  of "ticks"
  4147.                         indicated by  the passed  parameter. Each  tick  is
  4148.                         1/18 of a second (or 55 miliseconds).
  4149.  
  4150.           Return Value  None.
  4151.  
  4152.           Example       timer(18);      // pause for 1 second
  4153.  
  4154.  
  4155.  
  4156.  
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.  
  4166.  
  4167.  
  4168.  
  4169.  
  4170.  
  4171.  
  4172.  
  4173.  
  4174.  
  4175.  
  4176.  
  4177.  
  4178.  
  4179.  
  4180.  
  4181.  
  4182.                                        Page 73
  4183.  
  4184.  
  4185.  
  4186.           GAP Communications                                         GAPCDR
  4187.  
  4188.  
  4189.           time_credit
  4190.           -----------------------------------------------------------------
  4191.  
  4192.           Purpose       Issues timecredits to user.
  4193.  
  4194.                         void time_credit(short flag);
  4195.  
  4196.                         flag       1 = start timer
  4197.                                    0 = end timer
  4198.  
  4199.  
  4200.           Type          High Level
  4201.  
  4202.           Description   This is  basically an  internal routine  called  by
  4203.                         chat and sysop shell to DOS so that the user is not
  4204.                         penalized  for  time  used.  It  updates  a  global
  4205.                         variable called  timecredit. Timecredit  is used in
  4206.                         the calculations  that determine  the  user's  time
  4207.                         remaining.
  4208.  
  4209.                         If you  wish to  use this  feature in your own rou-
  4210.                         tines,  prior   to  entering   your  routine,  call
  4211.                         time_credit with  a 1  and it will start the timer.
  4212.                         When your  routine is  finished,  call  time_credit
  4213.                         with a  0 and  the timer  will stop.  The  variable
  4214.                         timecredit will be updated with the elapsed time.
  4215.  
  4216.           Return Value  None.
  4217.  
  4218.           Example       time_credit(1);   // start the timer
  4219.  
  4220.              time_credit(1);              // start the timer
  4221.              do_chat();                   // chat with user
  4222.              time_credit(0);              // stop the timer
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228.  
  4229.  
  4230.  
  4231.  
  4232.  
  4233.  
  4234.  
  4235.  
  4236.  
  4237.  
  4238.  
  4239.  
  4240.                                        Page 74
  4241.  
  4242.  
  4243.  
  4244.           GAP Communications                                         GAPCDR
  4245.  
  4246.  
  4247.           time_left
  4248.           -----------------------------------------------------------------
  4249.  
  4250.           Purpose       To compute the user's time remaining.
  4251.  
  4252.                         void time_left(void);
  4253.  
  4254.           Type          High Level
  4255.  
  4256.           Description   This is  the function  that is  called by the input
  4257.                         and output  routines to  compute  the  user's  time
  4258.                         remaining. It  is not  necessary for the programmer
  4259.                         to call this routine directly.
  4260.  
  4261.                         A global  variable called  timeleft will be updated
  4262.                         with each  call.  This  variable  may  be  used  in
  4263.                         prompts that display the user's remaining time.
  4264.  
  4265.                         As long as all input/output is performed thru calls
  4266.                         to the  GAPCDR library,  the timeleft variable will
  4267.                         always be current.
  4268.  
  4269.           Return Value  None.
  4270.  
  4271.           Example       time_left();      // calculate time remaining
  4272.  
  4273.  
  4274.  
  4275.           trim
  4276.           -----------------------------------------------------------------
  4277.  
  4278.           Purpose       Trims  spaces  from  the  end  of  NULL  terminated
  4279.                         strings.
  4280.  
  4281.                         char *trim(char *string);
  4282.  
  4283.                         string     String containing trailing spaces
  4284.  
  4285.           Type          High Level
  4286.  
  4287.           Description   This function  will remove  any spaces from the end
  4288.                         of a string. It modifies the passed string.
  4289.  
  4290.           Return Value  Pointer to the string without the spaces.
  4291.  
  4292.           Example       trim(username);      // get rid of spaces
  4293.  
  4294.  
  4295.  
  4296.  
  4297.  
  4298.                                        Page 75
  4299.  
  4300.  
  4301.  
  4302.           GAP Communications                                         GAPCDR
  4303.  
  4304.  
  4305.           update_clock
  4306.           -----------------------------------------------------------------
  4307.  
  4308.           Purpose       Updates the status line clock.
  4309.  
  4310.                         void update_clock(void);
  4311.  
  4312.           Type          High Level
  4313.  
  4314.           Description   Internal routine to update the status line clock.
  4315.  
  4316.           Return Value  None.
  4317.  
  4318.           Example
  4319.  
  4320.  
  4321.  
  4322.           wrap_word
  4323.           -----------------------------------------------------------------
  4324.  
  4325.           Purpose       To wrap a word during sysop chats.
  4326.  
  4327.                         void wrap_word(void);
  4328.  
  4329.           Type          Low Level
  4330.  
  4331.           Description   Internal function called by putkey to wrap words.
  4332.  
  4333.           Return Value  None.
  4334.  
  4335.           Example
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356.                                        Page 76
  4357.  
  4358.  
  4359.  
  4360.           GAP Communications                                         GAPCDR
  4361.  
  4362.  
  4363.           write_gapuser
  4364.           -----------------------------------------------------------------
  4365.  
  4366.           Purpose       Updates the user record in GAP's USERS.DAT file.
  4367.  
  4368.                         short write_gapuser(char *path);
  4369.  
  4370.                         path       Full path and name of Users File
  4371.  
  4372.           Type          High Level
  4373.  
  4374.           Description   This function allows you to update any variables in
  4375.                         the GAP  USERS.DAT file  for the  current user. You
  4376.                         must first  read the  user record  before  you  can
  4377.                         write to it.
  4378.  
  4379.                         You must  pass the path and name of the Users file.
  4380.                         The  name   is  obtained   by  reading  GAPBBS.CNF.
  4381.                         Write_gapuser will add the .DAT extension.
  4382.  
  4383.                         WARNING :  The GAP  USERS.DAT file contains strings
  4384.                         that are  fully padded  with spaces.  If you modify
  4385.                         any of  these strings,  you MUST make sure that the
  4386.                         string is  fully padded  with spaces  and that  the
  4387.                         NULL character  is placed  in the last string posi-
  4388.                         tion.
  4389.  
  4390.                         WARNING : The indexes for the user file consists of
  4391.                         the user's  last name and first name, user's level,
  4392.                         and user's  handle. Do  not under any circumstances
  4393.                         modify either  of these  four fields. Doing so will
  4394.                         cause corruption of the Index file.
  4395.  
  4396.           Return Value  0 = no error, 1 = error.
  4397.  
  4398.           Example       c = write_gapuser(userpath);
  4399.  
  4400.              // allow user to change city and state
  4401.  
  4402.              c = read_gapuser(userpath);
  4403.  
  4404.              if (c == 0)
  4405.                {
  4406.                show_mess("Enter City/State : ",NO,NO);
  4407.  
  4408.                empty(city,29);            // clear string
  4409.                get_string(city);          // get response
  4410.  
  4411.  
  4412.  
  4413.  
  4414.                                        Page 77
  4415.  
  4416.  
  4417.  
  4418.           GAP Communications                                         GAPCDR
  4419.  
  4420.  
  4421.                if (city[0] != 0)          // if something entered
  4422.                  {
  4423.                  strcpy(user.city,city);  // copy it
  4424.                  pad(user.city,29);       // pad it with spaces
  4425.                  c = write_gapuser(userpath);     // update user record
  4426.  
  4427.                  if (c == 0)
  4428.                    show_mess("Saved new City",NO,YES);
  4429.                  }
  4430.                }
  4431.  
  4432.  
  4433.           write_pcbsys
  4434.           -----------------------------------------------------------------
  4435.  
  4436.           Purpose       Updates the PCBOARD.SYS file.
  4437.  
  4438.                         short write_pcbsys(void);
  4439.  
  4440.           Type          High Level
  4441.  
  4442.           Description   This function  allows the  programmer to update the
  4443.                         PCBOARD.SYS File.  You must  first  read  the  file
  4444.                         before you  write to it and you should not use this
  4445.                         function unless  you  know  that  your  program  is
  4446.                         running with PCB as the host system.
  4447.  
  4448.           Return Value  0 = no error, 1 = error.
  4449.  
  4450.           Example       c = write_pcbsys()   // write the file
  4451.  
  4452.  
  4453.  
  4454.  
  4455.  
  4456.  
  4457.  
  4458.  
  4459.  
  4460.  
  4461.  
  4462.  
  4463.  
  4464.  
  4465.  
  4466.  
  4467.  
  4468.  
  4469.  
  4470.  
  4471.  
  4472.                                        Page 78
  4473.  
  4474.  
  4475.  
  4476.           GAP Communications                                         GAPCDR
  4477.  
  4478.  
  4479.           write_pcbuser
  4480.           -----------------------------------------------------------------
  4481.  
  4482.           Purpose       Updates the PCB USERS file.
  4483.  
  4484.                         short write_pcbuser(char *path);
  4485.  
  4486.                         path       Full path and name to the Users file
  4487.  
  4488.           Type          High Level
  4489.  
  4490.           Description   This function  allows the  programmer to update the
  4491.                         PCB USERS  File. Do  not use  unless you  know your
  4492.                         program is  running under  a PCB  host system.  You
  4493.                         must first  read the  user record  before  you  can
  4494.                         write to it.
  4495.  
  4496.                         You must  pass the path and name of the Users file.
  4497.                         The name is obtained by reading PCBOARD.DAT.
  4498.  
  4499.           Return Value  0 = no error, 1 = error.
  4500.  
  4501.           Example       c = write_pcbuser(); // write the file
  4502.  
  4503.  
  4504.  
  4505.  
  4506.  
  4507.  
  4508.  
  4509.  
  4510.  
  4511.  
  4512.  
  4513.  
  4514.  
  4515.  
  4516.  
  4517.  
  4518.  
  4519.  
  4520.  
  4521.  
  4522.  
  4523.  
  4524.  
  4525.  
  4526.  
  4527.  
  4528.  
  4529.  
  4530.                                        Page 79
  4531.  
  4532.  
  4533.  
  4534.           GAP Communications                                         GAPCDR
  4535.  
  4536.  
  4537.           write_score
  4538.           -----------------------------------------------------------------
  4539.  
  4540.           Purpose       Creates and maintains a scoreboard.
  4541.  
  4542.                         void write_score(char *filename,long score);
  4543.  
  4544.                         filename   Path and name of data file to write to
  4545.                         score      Score to write
  4546.  
  4547.           Type          High Level
  4548.  
  4549.           Description   This function will create and maintain a scoreboard
  4550.                         of the top ten players. You pass it two parameters.
  4551.                         The first  is a  string containing  the name of the
  4552.                         data file  to create/maintain. The second is a long
  4553.                         unsigned integer containing the score to write. The
  4554.                         user's name and the current date are already known.
  4555.                         If the  sysop is  in the  door  at  the  time,  the
  4556.                         function will  simply return and not write a score.
  4557.                         The  scores   will  automatically   be  sorted   in
  4558.                         decreasing order  by the highest score. If you wish
  4559.                         to use  this routine  but your  points are  kept as
  4560.                         shorts instead  of longs,  simply cast  the  second
  4561.                         parameter to an unsigned long.
  4562.  
  4563.           Return Value  None.
  4564.  
  4565.           Example
  4566.  
  4567.              short points;
  4568.  
  4569.              points = 1000;
  4570.              write_score("TOURIST.DAT,(unsigned long) points);
  4571.  
  4572.  
  4573.  
  4574.  
  4575.  
  4576.  
  4577.  
  4578.  
  4579.  
  4580.  
  4581.  
  4582.  
  4583.  
  4584.  
  4585.  
  4586.  
  4587.  
  4588.                                        Page 80
  4589.  
  4590.  
  4591.  
  4592.           GAP Communications                                         GAPCDR
  4593.  
  4594.  
  4595.           Index
  4596.  
  4597.  
  4598.           Access1   27, 29
  4599.           Alarm     23
  4600.           Ansi 27, 29
  4601.           Ansi driver
  4602.             color   7, 43, 45, 53
  4603.             external     17, 20
  4604.             initializing 11, 50
  4605.             internal     7, 12, 43
  4606.           ANSI variables 8, 22
  4607.           Anystring 26
  4608.           Backspace 26, 27, 30
  4609.           Base address   9, 15, 25, 57, 67
  4610.           Base_add  25, 57, 67
  4611.           Batch file     16
  4612.           Baud 18, 19, 20, 23, 51
  4613.           Baud rate 6, 18, 19, 20, 23, 51, 67
  4614.           BBS
  4615.             default directory 26, 57
  4616.             name    26
  4617.             system files 14, 26, 59, 60, 77, 78, 79
  4618.           Bbs_dir   26, 57
  4619.           Bell 23, 72
  4620.           Birthday  26
  4621.           Board_name     26
  4622.           Bphone    24
  4623.           BS   26
  4624.           Business phone number    24
  4625.           Caller alarm   23
  4626.           Caller's birth date 26
  4627.           Carriage return     26
  4628.           Carrier   18, 19, 52, 54
  4629.           Characters
  4630.             sending to com port    27, 34
  4631.             sending to local & remote   27, 44
  4632.             sending to local screen     27, 53
  4633.           Chat 17, 25, 37, 56
  4634.           Chatting with user  25
  4635.           City 24
  4636.           Ckeypress 27, 30
  4637.           Clear_scrn     27, 31
  4638.           Clockon   25, 76
  4639.           Clr_buf   27, 31
  4640.           Cls  27, 31, 32
  4641.           Cls_all   27, 32
  4642.           Color     7, 20, 23, 25, 29, 43, 45, 47, 53, 68
  4643.  
  4644.  
  4645.  
  4646.                                        Page 81
  4647.  
  4648.  
  4649.  
  4650.           GAP Communications                                         GAPCDR
  4651.  
  4652.  
  4653.           Column    25
  4654.           Comgetc   19, 27, 33
  4655.           Comgetd   19, 27, 33
  4656.           Communications
  4657.             advanced applications  18
  4658.             base address 9, 15, 25, 57, 67
  4659.             baud rates   6, 18, 19, 20, 23, 67
  4660.             carrier 18, 19, 52, 54
  4661.             configuration file     9
  4662.             DTR     20
  4663.             FIFO buffers 6
  4664.             Functions
  4665.               clr_buf    27, 31
  4666.               comgetc    27, 33
  4667.               comgetd    27, 33
  4668.               computb    27, 34
  4669.               computc    27, 34
  4670.               computs    27, 35
  4671.               dtr   27, 38
  4672.               init_port  19, 20, 27, 51
  4673.               iscd  27, 52
  4674.               no_carrier 27, 54
  4675.               reset_port 19, 28, 62
  4676.               rts   28, 65
  4677.               rxempty    28, 65
  4678.               setport    19, 28, 67
  4679.             initializing 19, 50, 51, 67
  4680.             input   19, 33, 65
  4681.             interrupt    11, 19, 52, 62
  4682.             IRQ     9, 15, 25, 57, 67
  4683.             output  20, 34, 35
  4684.             port    11, 12, 18, 23, 57, 67
  4685.           Compilers
  4686.             compiling & linking    12
  4687.             cputs   12
  4688.             floating point    8, 13, 48
  4689.             function calling  13
  4690.             goto    13
  4691.             header files 8, 47
  4692.             printf  12
  4693.             Quick C 13
  4694.             supported    8
  4695.           Compiling 12
  4696.           Computb   27, 34
  4697.           Computc   20, 27, 34
  4698.           Computs   20, 27, 35
  4699.           Configuration file  9, 11, 15, 16, 57
  4700.             format  9, 15
  4701.  
  4702.  
  4703.  
  4704.                                        Page 82
  4705.  
  4706.  
  4707.  
  4708.           GAP Communications                                         GAPCDR
  4709.  
  4710.  
  4711.           Control characters  8
  4712.             editor  8
  4713.           Cputs     12
  4714.           CRLF 26, 45
  4715.           Ctrl-Break handler  11, 64, 68
  4716.           Curbytes  24
  4717.           Curfiles  23
  4718.           Current display color    25
  4719.           Current download bytes   24
  4720.           Current files downloaded 23
  4721.           Current time   25
  4722.           Cursoff   27, 35
  4723.           Curson    27, 36
  4724.           Cursor    27, 35, 36
  4725.           Curtime   26
  4726.           Date user's subscription expires   24
  4727.           Default color  23
  4728.           Delaying  73
  4729.           DESQview  18, 27, 30, 33, 39, 40, 41
  4730.           Dflt_color     23
  4731.           Display clock  25
  4732.           Display color  25
  4733.           Distribution files  7
  4734.           Do_chat   27, 37
  4735.           DOOR.SYS  7, 9, 12, 14, 26, 58
  4736.             Universal format  7
  4737.             Variables    23
  4738.           Doors     16
  4739.           Doors opened   24
  4740.           Doors_opened   24
  4741.           DOS shell 17, 20
  4742.           DOS Window     20, 47, 63, 64, 66, 68, 69, 70
  4743.           Downbytes 24
  4744.           Download bytes 24
  4745.           Downloads 24
  4746.           DSZ  20
  4747.           DTR  20, 27, 38
  4748.           Dv_here   18, 27, 39
  4749.           Dv_pause  18, 27, 30, 40, 41
  4750.           Editor    8
  4751.             control characters     8
  4752.           Elap_time 27, 41
  4753.           Empty     27, 42, 49
  4754.           Endview   25
  4755.           Event_time     24
  4756.           Expert    23
  4757.           Files
  4758.             checking for existence of   27, 29
  4759.  
  4760.  
  4761.  
  4762.                                        Page 83
  4763.  
  4764.  
  4765.  
  4766.           GAP Communications                                         GAPCDR
  4767.  
  4768.  
  4769.             configuration     9, 15
  4770.             displaying   25, 71
  4771.             DOOR.SYS     7, 9, 14
  4772.             GAPCDR.H     8, 11
  4773.             GAPSTRUC.H   8
  4774.             PCBOARD.SYS  14
  4775.           First name     24
  4776.           Fix_color 27, 43
  4777.           Flag 25
  4778.           Floating point 8, 13, 48
  4779.           Fname     24
  4780.           Full name 24
  4781.           Function calling    13
  4782.           Function keys  17
  4783.           Functions
  4784.             access1 27, 29
  4785.             ansi    29
  4786.             backspace    30
  4787.             ckeypress    30
  4788.             clear_scrn   31
  4789.             clr_buf 31
  4790.             cls     31, 32
  4791.             cls_all 32
  4792.             comgetc 19, 33
  4793.             comgetd 19, 33
  4794.             computb 34
  4795.             computc 20, 34
  4796.             computs 20, 35
  4797.             cursoff 35
  4798.             curson  36
  4799.             do_chat 37
  4800.             DOS Window   20
  4801.             dtr     38
  4802.             dv_here 18, 39
  4803.             dv_pause     18, 40
  4804.             elap_time    41
  4805.             empty   42, 49
  4806.             fix_color    43
  4807.             gapputc 44
  4808.             gapputs 45
  4809.             get_attr     20, 47
  4810.             get_random   48
  4811.             get_string   42, 49
  4812.             getakey 46
  4813.             getkeyc 47
  4814.             init_ansi    50
  4815.             init_com     50
  4816.             init_door    10, 11, 51
  4817.  
  4818.  
  4819.  
  4820.                                        Page 84
  4821.  
  4822.  
  4823.  
  4824.           GAP Communications                                         GAPCDR
  4825.  
  4826.  
  4827.             init_port    19, 20, 51
  4828.             iscd    52
  4829.             leave   11, 52
  4830.             lputc   53
  4831.             lputs   53
  4832.             more    53
  4833.             nl 54
  4834.             no_carrier   18, 54
  4835.             pagesysop    55
  4836.             pause   55
  4837.             putkey  56
  4838.             read_cnf     9, 10, 11, 57
  4839.             read_doorsys 58
  4840.             read_gapuser 12, 59
  4841.             read_pcbsys  12, 59
  4842.             read_pcbuser 60
  4843.             read_score   61
  4844.             reset_port   19, 62
  4845.             rest_cbreak  64
  4846.             rest_int10   64
  4847.             restore_screen    63
  4848.             rts     65
  4849.             rxempty 65
  4850.             save_screen  66
  4851.             set_attr     68
  4852.             set_cbreak   68
  4853.             set_cord     69
  4854.             set_int10    70
  4855.             set_port     19
  4856.             set_status   70
  4857.             setport 67
  4858.             show_file    71
  4859.             show_mess    45, 72
  4860.             time_credit  74
  4861.             time_left    75
  4862.             timer   18, 73
  4863.             trim    75
  4864.             update_clock 76
  4865.             wrap_word    76
  4866.             write_gapuser     77
  4867.             write_pcbsys 78
  4868.             write_pcbuser     79
  4869.             write_score  80
  4870.           GAPCDR.H  11
  4871.           Gapputc   27, 44
  4872.           Gapputs   27, 45
  4873.           GAPSTRUC.H     8, 47
  4874.           Gendir    26
  4875.  
  4876.  
  4877.  
  4878.                                        Page 85
  4879.  
  4880.  
  4881.  
  4882.           GAP Communications                                         GAPCDR
  4883.  
  4884.  
  4885.           Get_attr  20, 27, 47
  4886.           Get_random     27, 48
  4887.           Get_string     27, 42, 49
  4888.           Getakey   27, 46
  4889.           Getkeyc   27, 47
  4890.           Gotdv     18
  4891.           Goto 13
  4892.           Handle    24
  4893.           Header files
  4894.             GAPCDR.H     8, 11
  4895.             GAPSTRUC.H   8, 47
  4896.           Home phone number   24
  4897.           Hphone    24
  4898.           Init_ansi 27, 50
  4899.           Init_com  27, 50
  4900.           Init_door 10, 11, 27, 51
  4901.           Init_port 19, 20, 27, 51
  4902.           Initializing
  4903.             ANSI driver  11, 43, 50
  4904.             interrupt handlers     11, 67
  4905.             program 11, 47, 50, 51, 57, 58, 67, 68
  4906.             strings 27, 42, 49
  4907.           Input
  4908.             from com port     19, 27, 33, 65
  4909.             from local & remote    27, 30, 40, 46, 49
  4910.             from local keyboard    27, 47
  4911.           Instatus  25
  4912.           Interrupt handlers
  4913.             BIOS    64, 70
  4914.             communications    19, 52, 62
  4915.             CTRL-Break   11, 52, 64, 68
  4916.           IRQ  9, 15, 25, 57, 67
  4917.           Iscd 27, 52
  4918.           Keyboard  30, 40, 46, 47, 49
  4919.             timeout 30, 49
  4920.           Last date user was on    24
  4921.           Last name 24
  4922.           Last new files scan 24
  4923.           Last_new  24
  4924.           Lastdate  24
  4925.           Leave     11, 27, 52
  4926.           Level     23
  4927.           Line feed 26
  4928.           Lines     25, 53, 54
  4929.           Linking   12
  4930.           Lname     24
  4931.           Local     18, 23
  4932.             Functions
  4933.  
  4934.  
  4935.  
  4936.                                        Page 86
  4937.  
  4938.  
  4939.  
  4940.           GAP Communications                                         GAPCDR
  4941.  
  4942.  
  4943.               cls   27, 32
  4944.               cls_all    27, 32
  4945.               cursoff    27, 35
  4946.               curson     27, 36
  4947.               getkeyc    27, 47
  4948.               lputc 27, 53
  4949.               lputs 27, 53
  4950.           Local mode     12, 18
  4951.           Lowercase characters     25, 49
  4952.           Lputc     27, 53
  4953.           Lputs     27, 53
  4954.           Maindir   26
  4955.           Make_sound     27
  4956.           Maxbytes  24
  4957.           Maxfiles  23
  4958.           Maximum bytes available  24
  4959.           Maximum files available  23
  4960.           Mesleft   24
  4961.           Messages left  24
  4962.           Minsleft  23
  4963.           Minutes left at door start    23
  4964.           More prompt    25, 27, 53
  4965.           Multi     12, 23
  4966.           Multi user     12, 16, 29
  4967.           Name of the BBS     26
  4968.           NL   27, 54, 72
  4969.           No clock  25
  4970.           No_carrier     18, 19, 27, 54
  4971.           Node 23
  4972.           Node number    23
  4973.           Non Stop mode  25
  4974.           Normal    25
  4975.           Noup 25, 49
  4976.           Novice    23
  4977.           NS   25, 53
  4978.           Number of downloads 24
  4979.           Number of times on  24
  4980.           Output
  4981.             to com port  20, 27, 34, 35
  4982.             to local & remote 27, 28, 44, 45, 72
  4983.             to local screen   27, 53
  4984.           Page 23
  4985.           Page bell 17, 23, 55
  4986.           Page length    23, 53
  4987.           Pagesysop 27, 55
  4988.           Parity    23
  4989.           Pascal
  4990.             function calling  13
  4991.  
  4992.  
  4993.  
  4994.                                        Page 87
  4995.  
  4996.  
  4997.  
  4998.           GAP Communications                                         GAPCDR
  4999.  
  5000.  
  5001.           Password  24
  5002.           Path to DOOR.SYS    26
  5003.           Pause     27, 55
  5004.           Pausing   73
  5005.           PCBOARD.SYS    14
  5006.           PKUNZIP   20
  5007.           Port 18, 19, 23, 57, 67
  5008.           Printer   23
  5009.           Printf    12
  5010.           Prompts
  5011.             more    53
  5012.             pause   55
  5013.           Putkey    27, 56
  5014.           Quick C   13
  5015.           Random number generator  11, 27, 48
  5016.           Read_cnf  9, 10, 11, 27, 57
  5017.           Read_doorsys   28, 58
  5018.           Read_gapuser   12, 28, 59
  5019.           Read_pcbsys    12, 28, 59
  5020.           Read_pcbuser   28, 60
  5021.           Read_score     28, 61
  5022.           Realcredit     23
  5023.           Receive buffer 30, 31, 33, 65, 67
  5024.           Recnum    24
  5025.           Redisplay 25
  5026.           Remote user    23
  5027.           Remote user's bps rate   23
  5028.           Reset_port     19, 28, 62
  5029.           Rest_cbreak    28, 64
  5030.           Rest_int10     28, 64
  5031.           Restore_screen 28, 63
  5032.           Rts  28, 65
  5033.           Rxempty   28, 65
  5034.           Save_screen    28, 66
  5035.           Scan codes     47
  5036.           Scoreboard     61, 80
  5037.           Screen    23, 63, 66
  5038.             clearing     31, 32
  5039.             color   47, 53, 68
  5040.             cursor  35, 36
  5041.             full    53
  5042.           Set_attr  28, 68
  5043.           Set_cbreak     28, 68
  5044.           Set_cord  28, 69
  5045.           Set_int10 28, 70
  5046.           Set_status     28, 70
  5047.           Setport   19, 28, 67
  5048.           Shell to DOS   17
  5049.  
  5050.  
  5051.  
  5052.                                        Page 88
  5053.  
  5054.  
  5055.  
  5056.           GAP Communications                                         GAPCDR
  5057.  
  5058.  
  5059.           Show_file 28, 71
  5060.           Show_mess 28, 45, 72
  5061.           Single user    12, 23
  5062.           Starttime 25
  5063.           Status line
  5064.             displaying   17, 25, 70
  5065.             protected    17
  5066.           Strings
  5067.             initializing 27, 42, 49
  5068.             receiving from local & remote    27, 42, 49
  5069.             removing spaces from   75
  5070.             sending to com port    27, 35
  5071.             sending to local & remote   27, 45, 72
  5072.             sending to local screen     27, 53
  5073.           Strtime   26
  5074.           Structures     26
  5075.           Subscrip  24
  5076.           Sysname   26
  5077.           Sysop
  5078.             batch file   16
  5079.             function keys     17
  5080.             functions    14, 17
  5081.             setup   14
  5082.           Sysop's name   26
  5083.           System files   14, 59, 60, 77, 78, 79
  5084.           Temptime  25
  5085.           Time 25
  5086.           Time credits   23, 74
  5087.           Time door opened    25
  5088.           Time slice     18, 30, 33, 39, 40, 41
  5089.           Time user has left  25, 41, 46, 75
  5090.           Time_credit    28, 74
  5091.           Time_left 28, 75
  5092.           Timecredit     14, 25
  5093.           Timeleft  25, 30, 46, 75
  5094.           Timenow   25
  5095.           Timeout   30
  5096.           Timer     18, 28, 73
  5097.           Timeson   24
  5098.           Total uploads  24
  5099.           Trim 28, 75
  5100.           Twit 17
  5101.           Upbytes   24
  5102.           Update_clock   28, 76
  5103.           Updating status line     25
  5104.           Upload bytes   24
  5105.           Uploads   24
  5106.           Uppercase characters     25, 49
  5107.  
  5108.  
  5109.  
  5110.                                        Page 89
  5111.  
  5112.  
  5113.  
  5114.           GAP Communications                                         GAPCDR
  5115.  
  5116.  
  5117.           Usemore1  25
  5118.           User Record    26
  5119.           User's birth date   26
  5120.           User's business phone    24
  5121.           User's first name   24
  5122.           User's full name    24
  5123.           User's Handle  24
  5124.           User's home phone   24
  5125.           User's home town    24
  5126.           User's last name    24
  5127.           User's password     24
  5128.           User's record number     24
  5129.           User's security level    23
  5130.           Userbaud  23
  5131.           Username  24
  5132.           Variables
  5133.             ANSI    8, 22
  5134.             Defines
  5135.               NO    22
  5136.               YES   22
  5137.             DOOR.SYS
  5138.               alarm 23
  5139.               baud  18, 23
  5140.               bell  23
  5141.               bphone     24
  5142.               city  24
  5143.               color 23
  5144.               curbytes   24
  5145.               curfiles   23
  5146.               dflt_color 23
  5147.               doors_open 24
  5148.               downbytes  24
  5149.               downloads  24
  5150.               event_time 24
  5151.               expert     23
  5152.               fname 24
  5153.               handle     24
  5154.               hphone     24
  5155.               last_new   24
  5156.               lastdate   24
  5157.               level 23
  5158.               lname 24
  5159.               local 18, 23
  5160.               maxbytes   24
  5161.               maxfiles   23
  5162.               mesleft    24
  5163.               minsleft   23
  5164.               multi 12, 23
  5165.  
  5166.  
  5167.  
  5168.                                        Page 90
  5169.  
  5170.  
  5171.  
  5172.           GAP Communications                                         GAPCDR
  5173.  
  5174.  
  5175.               node  23
  5176.               page  23
  5177.               parity     23
  5178.               password   24
  5179.               port  18, 19, 23
  5180.               printer    23
  5181.               realcredit 23
  5182.               recnum     24
  5183.               screen     23
  5184.               subscrip   24
  5185.               timeson    24
  5186.               upbytes    24
  5187.               uploads    24
  5188.               userbaud   23
  5189.               username   24
  5190.             Global
  5191.               anystring  26
  5192.               base_add   25
  5193.               bbs_dir    26
  5194.               birthday   26
  5195.               board_name 26
  5196.               BS    26
  5197.               chat  25
  5198.               clockon    25
  5199.               column     25
  5200.               CRLF  26, 45
  5201.               curtime    26
  5202.               endview    25
  5203.               flag  25
  5204.               gendir     26
  5205.               gotdv 18
  5206.               instatus   25
  5207.               IRQ   25
  5208.               lines 25
  5209.               maindir    26
  5210.               normal     25
  5211.               noup  25, 49
  5212.               NS    25
  5213.               redisplay  25
  5214.               starttime  25
  5215.               strtime    26
  5216.               sysname    26
  5217.               temptime   25
  5218.               timecredit 14, 25
  5219.               timeleft   25
  5220.               timenow    25
  5221.               usemore1   25
  5222.               view  25
  5223.  
  5224.  
  5225.  
  5226.                                        Page 91
  5227.  
  5228.  
  5229.  
  5230.           GAP Communications                                         GAPCDR
  5231.  
  5232.  
  5233.               wordwrap   25
  5234.             Structures
  5235.               pcbsys     26
  5236.               pcbuser    26
  5237.               user  26
  5238.           View 25
  5239.           Window    20, 63, 64, 66, 68, 69, 70
  5240.           Wordwrap  25, 56, 76
  5241.           Wrap_word 28, 76
  5242.           Write_gapuser  28, 77
  5243.           Write_pcbsys   28, 78
  5244.           Write_pcbuser  28, 79
  5245.           Write_score    28, 80
  5246.  
  5247.  
  5248.  
  5249.  
  5250.  
  5251.  
  5252.  
  5253.  
  5254.  
  5255.  
  5256.  
  5257.  
  5258.  
  5259.  
  5260.  
  5261.  
  5262.  
  5263.  
  5264.  
  5265.  
  5266.  
  5267.  
  5268.  
  5269.  
  5270.  
  5271.  
  5272.  
  5273.  
  5274.  
  5275.  
  5276.  
  5277.  
  5278.  
  5279.  
  5280.  
  5281.  
  5282.  
  5283.  
  5284.                                        Page 92